Class ImageModelSettingsObjectDetection
- java.lang.Object
-
- com.azure.resourcemanager.machinelearning.models.ImageModelSettings
-
- com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection
-
public final class ImageModelSettingsObjectDetection extends ImageModelSettings
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.
-
-
Constructor Summary
Constructors Constructor Description ImageModelSettingsObjectDetection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
boxDetectionsPerImage()
Get the boxDetectionsPerImage property: Maximum number of detections per image, for all classes.Float
boxScoreThreshold()
Get the boxScoreThreshold property: During inference, only return proposals with a classification score greater than BoxScoreThreshold.Integer
imageSize()
Get the imageSize property: Image size for train and validation.Integer
maxSize()
Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone.Integer
minSize()
Get the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone.ModelSize
modelSize()
Get the modelSize property: Model size.Boolean
multiScale()
Get the multiScale property: Enable multi-scale image by varying image size by +/- 50%.Float
nmsIouThreshold()
Get the nmsIouThreshold property: IOU threshold used during inference in NMS post processing.String
tileGridSize()
Get the tileGridSize property: The grid size to use for tiling each image.Float
tileOverlapRatio()
Get the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension.Float
tilePredictionsNmsThreshold()
Get the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions from tiles and image.void
validate()
Validates the instance.Float
validationIouThreshold()
Get the validationIouThreshold property: IOU threshold to use when computing validation metric.ValidationMetricType
validationMetricType()
Get the validationMetricType property: Metric computation method to use for validation metrics.ImageModelSettingsObjectDetection
withAdvancedSettings(String advancedSettings)
Set the advancedSettings property: Settings for advanced scenarios.ImageModelSettingsObjectDetection
withAmsGradient(Boolean amsGradient)
Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.ImageModelSettingsObjectDetection
withAugmentations(String augmentations)
Set the augmentations property: Settings for using Augmentations.ImageModelSettingsObjectDetection
withBeta1(Float beta1)
Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'.ImageModelSettingsObjectDetection
withBeta2(Float beta2)
Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'.ImageModelSettingsObjectDetection
withBoxDetectionsPerImage(Integer boxDetectionsPerImage)
Set the boxDetectionsPerImage property: Maximum number of detections per image, for all classes.ImageModelSettingsObjectDetection
withBoxScoreThreshold(Float boxScoreThreshold)
Set the boxScoreThreshold property: During inference, only return proposals with a classification score greater than BoxScoreThreshold.ImageModelSettingsObjectDetection
withCheckpointDatasetId(String checkpointDatasetId)
Set the checkpointDatasetId property: FileDataset id for pretrained checkpoint(s) for incremental training.ImageModelSettingsObjectDetection
withCheckpointFilename(String checkpointFilename)
Set the checkpointFilename property: The pretrained checkpoint filename in FileDataset for incremental training.ImageModelSettingsObjectDetection
withCheckpointFrequency(Integer checkpointFrequency)
Set the checkpointFrequency property: Frequency to store model checkpoints.ImageModelSettingsObjectDetection
withCheckpointRunId(String checkpointRunId)
Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.ImageModelSettingsObjectDetection
withDistributed(Boolean distributed)
Set the distributed property: Whether to use distributed training.ImageModelSettingsObjectDetection
withEarlyStopping(Boolean earlyStopping)
Set the earlyStopping property: Enable early stopping logic during training.ImageModelSettingsObjectDetection
withEarlyStoppingDelay(Integer earlyStoppingDelay)
Set the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary metric improvement is tracked for early stopping.ImageModelSettingsObjectDetection
withEarlyStoppingPatience(Integer earlyStoppingPatience)
Set the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric improvement before the run is stopped.ImageModelSettingsObjectDetection
withEnableOnnxNormalization(Boolean enableOnnxNormalization)
Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.ImageModelSettingsObjectDetection
withEvaluationFrequency(Integer evaluationFrequency)
Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores.ImageModelSettingsObjectDetection
withGradientAccumulationStep(Integer gradientAccumulationStep)
Set the gradientAccumulationStep property: 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.ImageModelSettingsObjectDetection
withImageSize(Integer imageSize)
Set the imageSize property: Image size for train and validation.ImageModelSettingsObjectDetection
withLayersToFreeze(Integer layersToFreeze)
Set the layersToFreeze property: Number of layers to freeze for the model.ImageModelSettingsObjectDetection
withLearningRate(Float learningRate)
Set the learningRate property: Initial learning rate.ImageModelSettingsObjectDetection
withLearningRateScheduler(LearningRateScheduler learningRateScheduler)
Set the learningRateScheduler property: Type of learning rate scheduler.ImageModelSettingsObjectDetection
withMaxSize(Integer maxSize)
Set the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone.ImageModelSettingsObjectDetection
withMinSize(Integer minSize)
Set the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone.ImageModelSettingsObjectDetection
withModelName(String modelName)
Set the modelName property: Name of the model to use for training.ImageModelSettingsObjectDetection
withModelSize(ModelSize modelSize)
Set the modelSize property: Model size.ImageModelSettingsObjectDetection
withMomentum(Float momentum)
Set the momentum property: Value of momentum when optimizer is 'sgd'.ImageModelSettingsObjectDetection
withMultiScale(Boolean multiScale)
Set the multiScale property: Enable multi-scale image by varying image size by +/- 50%.ImageModelSettingsObjectDetection
withNesterov(Boolean nesterov)
Set the nesterov property: Enable nesterov when optimizer is 'sgd'.ImageModelSettingsObjectDetection
withNmsIouThreshold(Float nmsIouThreshold)
Set the nmsIouThreshold property: IOU threshold used during inference in NMS post processing.ImageModelSettingsObjectDetection
withNumberOfEpochs(Integer numberOfEpochs)
Set the numberOfEpochs property: Number of training epochs.ImageModelSettingsObjectDetection
withNumberOfWorkers(Integer numberOfWorkers)
Set the numberOfWorkers property: Number of data loader workers.ImageModelSettingsObjectDetection
withOptimizer(StochasticOptimizer optimizer)
Set the optimizer property: Type of optimizer.ImageModelSettingsObjectDetection
withRandomSeed(Integer randomSeed)
Set the randomSeed property: Random seed to be used when using deterministic training.ImageModelSettingsObjectDetection
withSplitRatio(Float splitRatio)
Set the splitRatio property: If validation data is not defined, this specifies the split ratio for splitting train data into random train and validation subsets.ImageModelSettingsObjectDetection
withStepLRGamma(Float stepLRGamma)
Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'.ImageModelSettingsObjectDetection
withStepLRStepSize(Integer stepLRStepSize)
Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'.ImageModelSettingsObjectDetection
withTileGridSize(String tileGridSize)
Set the tileGridSize property: The grid size to use for tiling each image.ImageModelSettingsObjectDetection
withTileOverlapRatio(Float tileOverlapRatio)
Set the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension.ImageModelSettingsObjectDetection
withTilePredictionsNmsThreshold(Float tilePredictionsNmsThreshold)
Set the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions from tiles and image.ImageModelSettingsObjectDetection
withTrainingBatchSize(Integer trainingBatchSize)
Set the trainingBatchSize property: Training batch size.ImageModelSettingsObjectDetection
withValidationBatchSize(Integer validationBatchSize)
Set the validationBatchSize property: Validation batch size.ImageModelSettingsObjectDetection
withValidationIouThreshold(Float validationIouThreshold)
Set the validationIouThreshold property: IOU threshold to use when computing validation metric.ImageModelSettingsObjectDetection
withValidationMetricType(ValidationMetricType validationMetricType)
Set the validationMetricType property: Metric computation method to use for validation metrics.ImageModelSettingsObjectDetection
withWarmupCosineLRCycles(Float warmupCosineLRCycles)
Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'.ImageModelSettingsObjectDetection
withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRWarmupEpochs)
Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'.ImageModelSettingsObjectDetection
withWeightDecay(Float weightDecay)
Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'.-
Methods inherited from class com.azure.resourcemanager.machinelearning.models.ImageModelSettings
advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointDatasetId, checkpointFilename, checkpointFrequency, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, splitRatio, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay
-
-
-
-
Method Detail
-
boxDetectionsPerImage
public Integer boxDetectionsPerImage()
Get the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a positive integer. Note: This settings is not supported for the 'yolov5' algorithm.- Returns:
- the boxDetectionsPerImage value.
-
withBoxDetectionsPerImage
public ImageModelSettingsObjectDetection withBoxDetectionsPerImage(Integer boxDetectionsPerImage)
Set the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a positive integer. Note: This settings is not supported for the 'yolov5' algorithm.- Parameters:
boxDetectionsPerImage
- the boxDetectionsPerImage value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
boxScoreThreshold
public Float boxScoreThreshold()
Get the boxScoreThreshold property: During inference, only return proposals with a classification score greater than BoxScoreThreshold. Must be a float in the range[0, 1].- Returns:
- the boxScoreThreshold value.
-
withBoxScoreThreshold
public ImageModelSettingsObjectDetection withBoxScoreThreshold(Float boxScoreThreshold)
Set the boxScoreThreshold property: During inference, only return proposals with a classification score greater than BoxScoreThreshold. Must be a float in the range[0, 1].- Parameters:
boxScoreThreshold
- the boxScoreThreshold value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
imageSize
public Integer imageSize()
Get the imageSize property: 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.- Returns:
- the imageSize value.
-
withImageSize
public ImageModelSettingsObjectDetection withImageSize(Integer imageSize)
Set the imageSize property: 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.- Parameters:
imageSize
- the imageSize value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
maxSize
public Integer maxSize()
Get the maxSize property: 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.- Returns:
- the maxSize value.
-
withMaxSize
public ImageModelSettingsObjectDetection withMaxSize(Integer maxSize)
Set the maxSize property: 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.- Parameters:
maxSize
- the maxSize value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
minSize
public Integer minSize()
Get the minSize property: 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.- Returns:
- the minSize value.
-
withMinSize
public ImageModelSettingsObjectDetection withMinSize(Integer minSize)
Set the minSize property: 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.- Parameters:
minSize
- the minSize value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
modelSize
public ModelSize modelSize()
Get the modelSize property: 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.- Returns:
- the modelSize value.
-
withModelSize
public ImageModelSettingsObjectDetection withModelSize(ModelSize modelSize)
Set the modelSize property: 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.- Parameters:
modelSize
- the modelSize value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
multiScale
public Boolean multiScale()
Get the multiScale property: 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.- Returns:
- the multiScale value.
-
withMultiScale
public ImageModelSettingsObjectDetection withMultiScale(Boolean multiScale)
Set the multiScale property: 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.- Parameters:
multiScale
- the multiScale value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
nmsIouThreshold
public Float nmsIouThreshold()
Get the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1].- Returns:
- the nmsIouThreshold value.
-
withNmsIouThreshold
public ImageModelSettingsObjectDetection withNmsIouThreshold(Float nmsIouThreshold)
Set the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1].- Parameters:
nmsIouThreshold
- the nmsIouThreshold value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
tileGridSize
public String tileGridSize()
Get the tileGridSize property: 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.- Returns:
- the tileGridSize value.
-
withTileGridSize
public ImageModelSettingsObjectDetection withTileGridSize(String tileGridSize)
Set the tileGridSize property: 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.- Parameters:
tileGridSize
- the tileGridSize value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
tileOverlapRatio
public Float tileOverlapRatio()
Get the tileOverlapRatio property: 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.- Returns:
- the tileOverlapRatio value.
-
withTileOverlapRatio
public ImageModelSettingsObjectDetection withTileOverlapRatio(Float tileOverlapRatio)
Set the tileOverlapRatio property: 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.- Parameters:
tileOverlapRatio
- the tileOverlapRatio value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
tilePredictionsNmsThreshold
public Float tilePredictionsNmsThreshold()
Get the tilePredictionsNmsThreshold property: 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.- Returns:
- the tilePredictionsNmsThreshold value.
-
withTilePredictionsNmsThreshold
public ImageModelSettingsObjectDetection withTilePredictionsNmsThreshold(Float tilePredictionsNmsThreshold)
Set the tilePredictionsNmsThreshold property: 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.- Parameters:
tilePredictionsNmsThreshold
- the tilePredictionsNmsThreshold value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
validationIouThreshold
public Float validationIouThreshold()
Get the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in the range [0, 1].- Returns:
- the validationIouThreshold value.
-
withValidationIouThreshold
public ImageModelSettingsObjectDetection withValidationIouThreshold(Float validationIouThreshold)
Set the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in the range [0, 1].- Parameters:
validationIouThreshold
- the validationIouThreshold value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
validationMetricType
public ValidationMetricType validationMetricType()
Get the validationMetricType property: Metric computation method to use for validation metrics.- Returns:
- the validationMetricType value.
-
withValidationMetricType
public ImageModelSettingsObjectDetection withValidationMetricType(ValidationMetricType validationMetricType)
Set the validationMetricType property: Metric computation method to use for validation metrics.- Parameters:
validationMetricType
- the validationMetricType value to set.- Returns:
- the ImageModelSettingsObjectDetection object itself.
-
withAdvancedSettings
public ImageModelSettingsObjectDetection withAdvancedSettings(String advancedSettings)
Set the advancedSettings property: Settings for advanced scenarios.- Overrides:
withAdvancedSettings
in classImageModelSettings
- Parameters:
advancedSettings
- the advancedSettings value to set.- Returns:
- the ImageModelSettings object itself.
-
withAmsGradient
public ImageModelSettingsObjectDetection withAmsGradient(Boolean amsGradient)
Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.- Overrides:
withAmsGradient
in classImageModelSettings
- Parameters:
amsGradient
- the amsGradient value to set.- Returns:
- the ImageModelSettings object itself.
-
withAugmentations
public ImageModelSettingsObjectDetection withAugmentations(String augmentations)
Set the augmentations property: Settings for using Augmentations.- Overrides:
withAugmentations
in classImageModelSettings
- Parameters:
augmentations
- the augmentations value to set.- Returns:
- the ImageModelSettings object itself.
-
withBeta1
public ImageModelSettingsObjectDetection withBeta1(Float beta1)
Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Overrides:
withBeta1
in classImageModelSettings
- Parameters:
beta1
- the beta1 value to set.- Returns:
- the ImageModelSettings object itself.
-
withBeta2
public ImageModelSettingsObjectDetection withBeta2(Float beta2)
Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Overrides:
withBeta2
in classImageModelSettings
- Parameters:
beta2
- the beta2 value to set.- Returns:
- the ImageModelSettings object itself.
-
withCheckpointDatasetId
public ImageModelSettingsObjectDetection withCheckpointDatasetId(String checkpointDatasetId)
Set the checkpointDatasetId property: FileDataset id for pretrained checkpoint(s) for incremental training. Make sure to pass CheckpointFilename along with CheckpointDatasetId.- Overrides:
withCheckpointDatasetId
in classImageModelSettings
- Parameters:
checkpointDatasetId
- the checkpointDatasetId value to set.- Returns:
- the ImageModelSettings object itself.
-
withCheckpointFilename
public ImageModelSettingsObjectDetection withCheckpointFilename(String checkpointFilename)
Set the checkpointFilename property: The pretrained checkpoint filename in FileDataset for incremental training. Make sure to pass CheckpointDatasetId along with CheckpointFilename.- Overrides:
withCheckpointFilename
in classImageModelSettings
- Parameters:
checkpointFilename
- the checkpointFilename value to set.- Returns:
- the ImageModelSettings object itself.
-
withCheckpointFrequency
public ImageModelSettingsObjectDetection withCheckpointFrequency(Integer checkpointFrequency)
Set the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer.- Overrides:
withCheckpointFrequency
in classImageModelSettings
- Parameters:
checkpointFrequency
- the checkpointFrequency value to set.- Returns:
- the ImageModelSettings object itself.
-
withCheckpointRunId
public ImageModelSettingsObjectDetection withCheckpointRunId(String checkpointRunId)
Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.- Overrides:
withCheckpointRunId
in classImageModelSettings
- Parameters:
checkpointRunId
- the checkpointRunId value to set.- Returns:
- the ImageModelSettings object itself.
-
withDistributed
public ImageModelSettingsObjectDetection withDistributed(Boolean distributed)
Set the distributed property: Whether to use distributed training.- Overrides:
withDistributed
in classImageModelSettings
- Parameters:
distributed
- the distributed value to set.- Returns:
- the ImageModelSettings object itself.
-
withEarlyStopping
public ImageModelSettingsObjectDetection withEarlyStopping(Boolean earlyStopping)
Set the earlyStopping property: Enable early stopping logic during training.- Overrides:
withEarlyStopping
in classImageModelSettings
- Parameters:
earlyStopping
- the earlyStopping value to set.- Returns:
- the ImageModelSettings object itself.
-
withEarlyStoppingDelay
public ImageModelSettingsObjectDetection withEarlyStoppingDelay(Integer earlyStoppingDelay)
Set the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary metric improvement is tracked for early stopping. Must be a positive integer.- Overrides:
withEarlyStoppingDelay
in classImageModelSettings
- Parameters:
earlyStoppingDelay
- the earlyStoppingDelay value to set.- Returns:
- the ImageModelSettings object itself.
-
withEarlyStoppingPatience
public ImageModelSettingsObjectDetection withEarlyStoppingPatience(Integer earlyStoppingPatience)
Set the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric improvement before the run is stopped. Must be a positive integer.- Overrides:
withEarlyStoppingPatience
in classImageModelSettings
- Parameters:
earlyStoppingPatience
- the earlyStoppingPatience value to set.- Returns:
- the ImageModelSettings object itself.
-
withEnableOnnxNormalization
public ImageModelSettingsObjectDetection withEnableOnnxNormalization(Boolean enableOnnxNormalization)
Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.- Overrides:
withEnableOnnxNormalization
in classImageModelSettings
- Parameters:
enableOnnxNormalization
- the enableOnnxNormalization value to set.- Returns:
- the ImageModelSettings object itself.
-
withEvaluationFrequency
public ImageModelSettingsObjectDetection withEvaluationFrequency(Integer evaluationFrequency)
Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.- Overrides:
withEvaluationFrequency
in classImageModelSettings
- Parameters:
evaluationFrequency
- the evaluationFrequency value to set.- Returns:
- the ImageModelSettings object itself.
-
withGradientAccumulationStep
public ImageModelSettingsObjectDetection withGradientAccumulationStep(Integer gradientAccumulationStep)
Set the gradientAccumulationStep property: 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.- Overrides:
withGradientAccumulationStep
in classImageModelSettings
- Parameters:
gradientAccumulationStep
- the gradientAccumulationStep value to set.- Returns:
- the ImageModelSettings object itself.
-
withLayersToFreeze
public ImageModelSettingsObjectDetection withLayersToFreeze(Integer layersToFreeze)
Set the layersToFreeze property: 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.- Overrides:
withLayersToFreeze
in classImageModelSettings
- Parameters:
layersToFreeze
- the layersToFreeze value to set.- Returns:
- the ImageModelSettings object itself.
-
withLearningRate
public ImageModelSettingsObjectDetection withLearningRate(Float learningRate)
Set the learningRate property: Initial learning rate. Must be a float in the range [0, 1].- Overrides:
withLearningRate
in classImageModelSettings
- Parameters:
learningRate
- the learningRate value to set.- Returns:
- the ImageModelSettings object itself.
-
withLearningRateScheduler
public ImageModelSettingsObjectDetection withLearningRateScheduler(LearningRateScheduler learningRateScheduler)
Set the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.- Overrides:
withLearningRateScheduler
in classImageModelSettings
- Parameters:
learningRateScheduler
- the learningRateScheduler value to set.- Returns:
- the ImageModelSettings object itself.
-
withModelName
public ImageModelSettingsObjectDetection withModelName(String modelName)
Set the modelName property: 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.- Overrides:
withModelName
in classImageModelSettings
- Parameters:
modelName
- the modelName value to set.- Returns:
- the ImageModelSettings object itself.
-
withMomentum
public ImageModelSettingsObjectDetection withMomentum(Float momentum)
Set the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1].- Overrides:
withMomentum
in classImageModelSettings
- Parameters:
momentum
- the momentum value to set.- Returns:
- the ImageModelSettings object itself.
-
withNesterov
public ImageModelSettingsObjectDetection withNesterov(Boolean nesterov)
Set the nesterov property: Enable nesterov when optimizer is 'sgd'.- Overrides:
withNesterov
in classImageModelSettings
- Parameters:
nesterov
- the nesterov value to set.- Returns:
- the ImageModelSettings object itself.
-
withNumberOfEpochs
public ImageModelSettingsObjectDetection withNumberOfEpochs(Integer numberOfEpochs)
Set the numberOfEpochs property: Number of training epochs. Must be a positive integer.- Overrides:
withNumberOfEpochs
in classImageModelSettings
- Parameters:
numberOfEpochs
- the numberOfEpochs value to set.- Returns:
- the ImageModelSettings object itself.
-
withNumberOfWorkers
public ImageModelSettingsObjectDetection withNumberOfWorkers(Integer numberOfWorkers)
Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.- Overrides:
withNumberOfWorkers
in classImageModelSettings
- Parameters:
numberOfWorkers
- the numberOfWorkers value to set.- Returns:
- the ImageModelSettings object itself.
-
withOptimizer
public ImageModelSettingsObjectDetection withOptimizer(StochasticOptimizer optimizer)
Set the optimizer property: Type of optimizer.- Overrides:
withOptimizer
in classImageModelSettings
- Parameters:
optimizer
- the optimizer value to set.- Returns:
- the ImageModelSettings object itself.
-
withRandomSeed
public ImageModelSettingsObjectDetection withRandomSeed(Integer randomSeed)
Set the randomSeed property: Random seed to be used when using deterministic training.- Overrides:
withRandomSeed
in classImageModelSettings
- Parameters:
randomSeed
- the randomSeed value to set.- Returns:
- the ImageModelSettings object itself.
-
withSplitRatio
public ImageModelSettingsObjectDetection withSplitRatio(Float splitRatio)
Set the splitRatio property: If validation data is not defined, this specifies the split ratio for splitting train data into random train and validation subsets. Must be a float in the range [0, 1].- Overrides:
withSplitRatio
in classImageModelSettings
- Parameters:
splitRatio
- the splitRatio value to set.- Returns:
- the ImageModelSettings object itself.
-
withStepLRGamma
public ImageModelSettingsObjectDetection withStepLRGamma(Float stepLRGamma)
Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1].- Overrides:
withStepLRGamma
in classImageModelSettings
- Parameters:
stepLRGamma
- the stepLRGamma value to set.- Returns:
- the ImageModelSettings object itself.
-
withStepLRStepSize
public ImageModelSettingsObjectDetection withStepLRStepSize(Integer stepLRStepSize)
Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive integer.- Overrides:
withStepLRStepSize
in classImageModelSettings
- Parameters:
stepLRStepSize
- the stepLRStepSize value to set.- Returns:
- the ImageModelSettings object itself.
-
withTrainingBatchSize
public ImageModelSettingsObjectDetection withTrainingBatchSize(Integer trainingBatchSize)
Set the trainingBatchSize property: Training batch size. Must be a positive integer.- Overrides:
withTrainingBatchSize
in classImageModelSettings
- Parameters:
trainingBatchSize
- the trainingBatchSize value to set.- Returns:
- the ImageModelSettings object itself.
-
withValidationBatchSize
public ImageModelSettingsObjectDetection withValidationBatchSize(Integer validationBatchSize)
Set the validationBatchSize property: Validation batch size. Must be a positive integer.- Overrides:
withValidationBatchSize
in classImageModelSettings
- Parameters:
validationBatchSize
- the validationBatchSize value to set.- Returns:
- the ImageModelSettings object itself.
-
withWarmupCosineLRCycles
public ImageModelSettingsObjectDetection withWarmupCosineLRCycles(Float warmupCosineLRCycles)
Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1].- Overrides:
withWarmupCosineLRCycles
in classImageModelSettings
- Parameters:
warmupCosineLRCycles
- the warmupCosineLRCycles value to set.- Returns:
- the ImageModelSettings object itself.
-
withWarmupCosineLRWarmupEpochs
public ImageModelSettingsObjectDetection withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRWarmupEpochs)
Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer.- Overrides:
withWarmupCosineLRWarmupEpochs
in classImageModelSettings
- Parameters:
warmupCosineLRWarmupEpochs
- the warmupCosineLRWarmupEpochs value to set.- Returns:
- the ImageModelSettings object itself.
-
withWeightDecay
public ImageModelSettingsObjectDetection withWeightDecay(Float weightDecay)
Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1].- Overrides:
withWeightDecay
in classImageModelSettings
- Parameters:
weightDecay
- the weightDecay value to set.- Returns:
- the ImageModelSettings object itself.
-
validate
public void validate()
Validates the instance.- Overrides:
validate
in classImageModelSettings
- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
-