-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ImageModelDistributionSettingsObjectDetection.cs
212 lines (207 loc) · 14.7 KB
/
ImageModelDistributionSettingsObjectDetection.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace Azure.ResourceManager.MachineLearning.Models
{
/// <summary>
/// Distribution expressions to sweep over values of model settings.
/// <example>
/// Some examples are:
/// ```
/// ModelName = "choice('seresnext', 'resnest50')";
/// LearningRate = "uniform(0.001, 0.01)";
/// LayersToFreeze = "choice(0, 2)";
/// ```</example>
/// For more details on how to compose distribution expressions please check the documentation:
/// https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters
/// 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 ImageModelDistributionSettingsObjectDetection : ImageModelDistributionSettings
{
/// <summary> Initializes a new instance of <see cref="ImageModelDistributionSettingsObjectDetection"/>. </summary>
public ImageModelDistributionSettingsObjectDetection()
{
}
/// <summary> Initializes a new instance of <see cref="ImageModelDistributionSettingsObjectDetection"/>. </summary>
/// <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="distributed"> Whether to use distributer 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. Must be either 'sgd', 'adam', or 'adamw'. </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="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 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.
/// NMS: Non-maximum suppression
/// </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. Must be 'none', 'coco', 'voc', or 'coco_voc'. </param>
internal ImageModelDistributionSettingsObjectDetection(string amsGradient, string augmentations, string beta1, string beta2, string distributed, string earlyStopping, string earlyStoppingDelay, string earlyStoppingPatience, string enableOnnxNormalization, string evaluationFrequency, string gradientAccumulationStep, string layersToFreeze, string learningRate, string learningRateScheduler, string modelName, string momentum, string nesterov, string numberOfEpochs, string numberOfWorkers, string optimizer, string randomSeed, string stepLRGamma, string stepLRStepSize, string trainingBatchSize, string validationBatchSize, string warmupCosineLRCycles, string warmupCosineLRWarmupEpochs, string weightDecay, string boxDetectionsPerImage, string boxScoreThreshold, string imageSize, string maxSize, string minSize, string modelSize, string multiScale, string nmsIouThreshold, string tileGridSize, string tileOverlapRatio, string tilePredictionsNmsThreshold, string validationIouThreshold, string validationMetricType) : base(amsGradient, augmentations, beta1, beta2, 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;
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 string 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 string 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 string ImageSize { 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 string 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 string 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 string 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 string MultiScale { get; set; }
/// <summary> IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1]. </summary>
public string 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 string 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.
/// NMS: Non-maximum suppression
/// </summary>
public string TilePredictionsNmsThreshold { get; set; }
/// <summary> IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. </summary>
public string ValidationIouThreshold { get; set; }
/// <summary> Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or 'coco_voc'. </summary>
public string ValidationMetricType { get; set; }
}
}