1 write to _options
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
568_options = options;
70 references to _options
Microsoft.ML.Vision (70)
ImageClassificationTrainer.cs (70)
553options.TrainSetBottleneckCachedValuesFileName = _options.TrainSetBottleneckCachedValuesFileName; 559options.ValidationSetBottleneckCachedValuesFileName = _options.ValidationSetBottleneckCachedValuesFileName; 569_useLRScheduling = _options.LearningRateScheduler != null; 570_checkpointPath = Path.Combine(_options.WorkspacePath, _options.FinalModelPrefix + 571ModelFileName[_options.Arch]); 572_sizeFile = Path.Combine(_options.WorkspacePath, "TrainingSetSize.txt"); 575var arch = _options.Arch; 600var labelColumn = input.Schema.GetColumnOrNull(_options.LabelColumnName).Value; 609var msg = $"Only one class found in the {_options.LabelColumnName} column. To build a multiclass classification model, the number of classes needs to be 2 or greater"; 613var imageSize = ImagePreprocessingSize[_options.Arch]; 614_session = LoadTensorFlowSessionFromMetaGraph(Host, _options.Arch).Session; 621AddTransferLearningLayer(_options.LabelColumnName, _options.ScoreColumnName, _options.LearningRate, 634bool success = inputSchema.TryFindColumn(_options.LabelColumnName, out _); 642new SchemaShape.Column(_options.ScoreColumnName, SchemaShape.Column.VectorKind.Vector, 644new SchemaShape.Column(_options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.Scalar, 652FeatureColumn.Name, LabelColumn.Name, _options.ScoreColumnName, _options.PredictedLabelColumnName); 659if (!Directory.Exists(_options.WorkspacePath)) 661Directory.CreateDirectory(_options.WorkspacePath); 665CheckTrainingParameters(_options); 666var validationSet = trainContext.ValidationSet?.Data ?? _options.ValidationSet; 668string trainSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 669_options.TrainSetBottleneckCachedValuesFileName); 671string validationSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 672_options.ValidationSetBottleneckCachedValuesFileName); 674bool needValidationSet = _options.EarlyStoppingCriteria != null || _options.MetricsCallback != null; 675bool validationSetPresent = _options.ReuseValidationSetBottleneckCachedValues && 681if (generateValidationSet && _options.ValidationSet != null) 683CacheFeaturizedImagesToDisk(validationSet, _options.LabelColumnName, 684_options.FeatureColumnName, imageProcessor, _inputTensorName, _bottleneckTensor.name, 686ImageClassificationMetrics.Dataset.Validation, _options.MetricsCallback); 692if (!_options.ReuseTrainSetBottleneckCachedValues || 696CacheFeaturizedImagesToDisk(trainContext.TrainingSet.Data, _options.LabelColumnName, 697_options.FeatureColumnName, imageProcessor, 699ImageClassificationMetrics.Dataset.Train, _options.MetricsCallback, 700generateValidationSet ? _options.ValidationSetFraction : null); 703(generateValidationSet && _options.ValidationSetFraction.HasValue); 708if (generateValidationSet && _options.ReuseTrainSetBottleneckCachedValues && 709!_options.ReuseValidationSetBottleneckCachedValues) 717validationSetPresent && (_options.EarlyStoppingCriteria != null || _options.MetricsCallback != null) ? 872Path.Combine(_options.WorkspacePath, _options.ValidationSetBottleneckCachedValuesFileName), 927Contracts.Assert(_options.EarlyStoppingCriteria == null || validationNeeded); 938int batchSize = _options.BatchSize; 939int epochs = _options.Epoch; 940float learningRate = _options.LearningRate; 941Action<ImageClassificationMetrics> statisticsCallback = _options.MetricsCallback; 948if (_options.LearningRateScheduler != null) 951if (statisticsCallback != null && _options.TestOnTrainSet) 970trainWriter = tf.summary.FileWriter(Path.Combine(_options.WorkspacePath, "train"), 997BatchSize = _options.BatchSize, 998BatchesPerEpoch = trainingExamples / _options.BatchSize 1009_options.LearningRateScheduler, trainState, runner, featureBufferPtr, labelBufferPtr, 1012if (_options.TestOnTrainSet && statisticsCallback != null) 1023if (_options.TestOnTrainSet && statisticsCallback != null) 1061if (_options.EarlyStoppingCriteria != null) 1063if (_options.EarlyStoppingCriteria.ShouldStop(metrics.Train)) 1150if (_cleanupWorkspace && Directory.Exists(_options.WorkspacePath)) 1154Directory.Delete(_options.WorkspacePath, true); 1165var evalGraph = LoadMetaGraph(Path.Combine(_resourcePath, ModelFileName[_options.Arch])); 1171var (_, _, groundTruthInput, finalTensor) = AddFinalRetrainOps(classCount, _options.LabelColumnName, 1172_options.ScoreColumnName, bottleneckTensor, false, (_options.LearningRateScheduler == null ? false : true), _options.LearningRate); 1175var imageSize = ImagePreprocessingSize[_options.Arch];