-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ImageModelSettingsObjectDetection.cs
213 lines (208 loc) · 15.3 KB
/
ImageModelSettingsObjectDetection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace Azure.ResourceManager.MachineLearning.Models
{
/// <summary>
/// Settings used for training the model.
/// For more information on the available settings please visit the official documentation:
/// https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.
/// </summary>
public partial class ImageModelSettingsObjectDetection : ImageModelSettings
{
/// <summary> Initializes a new instance of <see cref="ImageModelSettingsObjectDetection"/>. </summary>
public ImageModelSettingsObjectDetection()
{
}
/// <summary> Initializes a new instance of <see cref="ImageModelSettingsObjectDetection"/>. </summary>
/// <param name="advancedSettings"> Settings for advanced scenarios. </param>
/// <param name="amsGradient"> Enable AMSGrad when optimizer is 'adam' or 'adamw'. </param>
/// <param name="augmentations"> Settings for using Augmentations. </param>
/// <param name="beta1"> Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. </param>
/// <param name="beta2"> Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. </param>
/// <param name="checkpointFrequency"> Frequency to store model checkpoints. Must be a positive integer. </param>
/// <param name="checkpointModel"> The pretrained checkpoint model for incremental training. </param>
/// <param name="checkpointRunId"> The id of a previous run that has a pretrained checkpoint for incremental training. </param>
/// <param name="distributed"> Whether to use distributed training. </param>
/// <param name="earlyStopping"> Enable early stopping logic during training. </param>
/// <param name="earlyStoppingDelay">
/// Minimum number of epochs or validation evaluations to wait before primary metric improvement
/// is tracked for early stopping. Must be a positive integer.
/// </param>
/// <param name="earlyStoppingPatience">
/// Minimum number of epochs or validation evaluations with no primary metric improvement before
/// the run is stopped. Must be a positive integer.
/// </param>
/// <param name="enableOnnxNormalization"> Enable normalization when exporting ONNX model. </param>
/// <param name="evaluationFrequency"> Frequency to evaluate validation dataset to get metric scores. Must be a positive integer. </param>
/// <param name="gradientAccumulationStep">
/// Gradient accumulation means running a configured number of "GradAccumulationStep" steps without
/// updating the model weights while accumulating the gradients of those steps, and then using
/// the accumulated gradients to compute the weight updates. Must be a positive integer.
/// </param>
/// <param name="layersToFreeze">
/// Number of layers to freeze for the model. Must be a positive integer.
/// For instance, passing 2 as value for 'seresnext' means
/// freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please
/// see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.
/// </param>
/// <param name="learningRate"> Initial learning rate. Must be a float in the range [0, 1]. </param>
/// <param name="learningRateScheduler"> Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. </param>
/// <param name="modelName">
/// Name of the model to use for training.
/// For more information on the available models please visit the official documentation:
/// https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models.
/// </param>
/// <param name="momentum"> Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. </param>
/// <param name="nesterov"> Enable nesterov when optimizer is 'sgd'. </param>
/// <param name="numberOfEpochs"> Number of training epochs. Must be a positive integer. </param>
/// <param name="numberOfWorkers"> Number of data loader workers. Must be a non-negative integer. </param>
/// <param name="optimizer"> Type of optimizer. </param>
/// <param name="randomSeed"> Random seed to be used when using deterministic training. </param>
/// <param name="stepLRGamma"> Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]. </param>
/// <param name="stepLRStepSize"> Value of step size when learning rate scheduler is 'step'. Must be a positive integer. </param>
/// <param name="trainingBatchSize"> Training batch size. Must be a positive integer. </param>
/// <param name="validationBatchSize"> Validation batch size. Must be a positive integer. </param>
/// <param name="warmupCosineLRCycles"> Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]. </param>
/// <param name="warmupCosineLRWarmupEpochs"> Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer. </param>
/// <param name="weightDecay"> Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]. </param>
/// <param name="boxDetectionsPerImage">
/// Maximum number of detections per image, for all classes. Must be a positive integer.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="boxScoreThreshold">
/// During inference, only return proposals with a classification score greater than
/// BoxScoreThreshold. Must be a float in the range[0, 1].
/// </param>
/// <param name="imageSize">
/// Image size for train and validation. Must be a positive integer.
/// Note: The training run may get into CUDA OOM if the size is too big.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </param>
/// <param name="logTrainingMetrics"> Enable computing and logging training metrics. </param>
/// <param name="logValidationLoss"> Enable computing and logging validation loss. </param>
/// <param name="maxSize">
/// Maximum size of the image to be rescaled before feeding it to the backbone.
/// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="minSize">
/// Minimum size of the image to be rescaled before feeding it to the backbone.
/// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="modelSize">
/// Model size. Must be 'small', 'medium', 'large', or 'xlarge'.
/// Note: training run may get into CUDA OOM if the model size is too big.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </param>
/// <param name="multiScale">
/// Enable multi-scale image by varying image size by +/- 50%.
/// Note: training run may get into CUDA OOM if no sufficient GPU memory.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </param>
/// <param name="nmsIouThreshold"> IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]. </param>
/// <param name="tileGridSize">
/// The grid size to use for tiling each image. Note: TileGridSize must not be
/// None to enable small object detection logic. A string containing two integers in mxn format.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="tileOverlapRatio">
/// Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="tilePredictionsNmsThreshold">
/// The IOU threshold to use to perform NMS while merging predictions from tiles and image.
/// Used in validation/ inference. Must be float in the range [0, 1].
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </param>
/// <param name="validationIouThreshold"> IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. </param>
/// <param name="validationMetricType"> Metric computation method to use for validation metrics. </param>
internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, LogTrainingMetric? logTrainingMetrics, LogValidationLoss? logValidationLoss, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay)
{
BoxDetectionsPerImage = boxDetectionsPerImage;
BoxScoreThreshold = boxScoreThreshold;
ImageSize = imageSize;
LogTrainingMetrics = logTrainingMetrics;
LogValidationLoss = logValidationLoss;
MaxSize = maxSize;
MinSize = minSize;
ModelSize = modelSize;
MultiScale = multiScale;
NmsIouThreshold = nmsIouThreshold;
TileGridSize = tileGridSize;
TileOverlapRatio = tileOverlapRatio;
TilePredictionsNmsThreshold = tilePredictionsNmsThreshold;
ValidationIouThreshold = validationIouThreshold;
ValidationMetricType = validationMetricType;
}
/// <summary>
/// Maximum number of detections per image, for all classes. Must be a positive integer.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public int? BoxDetectionsPerImage { get; set; }
/// <summary>
/// During inference, only return proposals with a classification score greater than
/// BoxScoreThreshold. Must be a float in the range[0, 1].
/// </summary>
public float? BoxScoreThreshold { get; set; }
/// <summary>
/// Image size for train and validation. Must be a positive integer.
/// Note: The training run may get into CUDA OOM if the size is too big.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </summary>
public int? ImageSize { get; set; }
/// <summary> Enable computing and logging training metrics. </summary>
public LogTrainingMetric? LogTrainingMetrics { get; set; }
/// <summary> Enable computing and logging validation loss. </summary>
public LogValidationLoss? LogValidationLoss { get; set; }
/// <summary>
/// Maximum size of the image to be rescaled before feeding it to the backbone.
/// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public int? MaxSize { get; set; }
/// <summary>
/// Minimum size of the image to be rescaled before feeding it to the backbone.
/// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public int? MinSize { get; set; }
/// <summary>
/// Model size. Must be 'small', 'medium', 'large', or 'xlarge'.
/// Note: training run may get into CUDA OOM if the model size is too big.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </summary>
public MachineLearningModelSize? ModelSize { get; set; }
/// <summary>
/// Enable multi-scale image by varying image size by +/- 50%.
/// Note: training run may get into CUDA OOM if no sufficient GPU memory.
/// Note: This settings is only supported for the 'yolov5' algorithm.
/// </summary>
public bool? MultiScale { get; set; }
/// <summary> IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]. </summary>
public float? NmsIouThreshold { get; set; }
/// <summary>
/// The grid size to use for tiling each image. Note: TileGridSize must not be
/// None to enable small object detection logic. A string containing two integers in mxn format.
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public string TileGridSize { get; set; }
/// <summary>
/// Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1).
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public float? TileOverlapRatio { get; set; }
/// <summary>
/// The IOU threshold to use to perform NMS while merging predictions from tiles and image.
/// Used in validation/ inference. Must be float in the range [0, 1].
/// Note: This settings is not supported for the 'yolov5' algorithm.
/// </summary>
public float? TilePredictionsNmsThreshold { get; set; }
/// <summary> IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. </summary>
public float? ValidationIouThreshold { get; set; }
/// <summary> Metric computation method to use for validation metrics. </summary>
public ValidationMetricType? ValidationMetricType { get; set; }
}
}