Class ImageModelSettings
java.lang.Object
com.azure.resourcemanager.machinelearning.models.ImageModelSettings
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ImageModelSettings>
- Direct Known Subclasses:
ImageModelSettingsClassification,ImageModelSettingsObjectDetection
public class ImageModelSettings
extends Object
implements com.azure.json.JsonSerializable<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 -
Method Summary
Modifier and TypeMethodDescriptionGet the advancedSettings property: Settings for advanced scenarios.Get the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.Get the augmentations property: Settings for using Augmentations.beta1()Get the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'.beta2()Get the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'.Get the checkpointFrequency property: Frequency to store model checkpoints.Get the checkpointModel property: The pretrained checkpoint model for incremental training.Get the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.Get the distributed property: Whether to use distributed training.Get the earlyStopping property: Enable early stopping logic during training.Get the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary metric improvement is tracked for early stopping.Get the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric improvement before the run is stopped.Get the enableOnnxNormalization property: Enable normalization when exporting ONNX model.Get the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores.static ImageModelSettingsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ImageModelSettings from the JsonReader.Get 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.Get the layersToFreeze property: Number of layers to freeze for the model.Get the learningRate property: Initial learning rate.Get the learningRateScheduler property: Type of learning rate scheduler.Get the modelName property: Name of the model to use for training.momentum()Get the momentum property: Value of momentum when optimizer is 'sgd'.nesterov()Get the nesterov property: Enable nesterov when optimizer is 'sgd'.Get the numberOfEpochs property: Number of training epochs.Get the numberOfWorkers property: Number of data loader workers.Get the optimizer property: Type of optimizer.Get the randomSeed property: Random seed to be used when using deterministic training.Get the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'.Get the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the trainingBatchSize property: Training batch size.voidvalidate()Validates the instance.Get the validationBatchSize property: Validation batch size.Get the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'.Get the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'.Get the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'.withAdvancedSettings(String advancedSettings) Set the advancedSettings property: Settings for advanced scenarios.withAmsGradient(Boolean amsGradient) Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.withAugmentations(String augmentations) Set the augmentations property: Settings for using Augmentations.Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'.Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'.withCheckpointFrequency(Integer checkpointFrequency) Set the checkpointFrequency property: Frequency to store model checkpoints.withCheckpointModel(MLFlowModelJobInput checkpointModel) Set the checkpointModel property: The pretrained checkpoint model for incremental training.withCheckpointRunId(String checkpointRunId) Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.withDistributed(Boolean distributed) Set the distributed property: Whether to use distributed training.withEarlyStopping(Boolean earlyStopping) Set the earlyStopping property: Enable early stopping logic during training.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.withEarlyStoppingPatience(Integer earlyStoppingPatience) Set the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric improvement before the run is stopped.withEnableOnnxNormalization(Boolean enableOnnxNormalization) Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.withEvaluationFrequency(Integer evaluationFrequency) Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores.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.withLayersToFreeze(Integer layersToFreeze) Set the layersToFreeze property: Number of layers to freeze for the model.withLearningRate(Float learningRate) Set the learningRate property: Initial learning rate.withLearningRateScheduler(LearningRateScheduler learningRateScheduler) Set the learningRateScheduler property: Type of learning rate scheduler.withModelName(String modelName) Set the modelName property: Name of the model to use for training.withMomentum(Float momentum) Set the momentum property: Value of momentum when optimizer is 'sgd'.withNesterov(Boolean nesterov) Set the nesterov property: Enable nesterov when optimizer is 'sgd'.withNumberOfEpochs(Integer numberOfEpochs) Set the numberOfEpochs property: Number of training epochs.withNumberOfWorkers(Integer numberOfWorkers) Set the numberOfWorkers property: Number of data loader workers.withOptimizer(StochasticOptimizer optimizer) Set the optimizer property: Type of optimizer.withRandomSeed(Integer randomSeed) Set the randomSeed property: Random seed to be used when using deterministic training.withStepLRGamma(Float stepLRGamma) Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'.withStepLRStepSize(Integer stepLRStepSize) Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'.withTrainingBatchSize(Integer trainingBatchSize) Set the trainingBatchSize property: Training batch size.withValidationBatchSize(Integer validationBatchSize) Set the validationBatchSize property: Validation batch size.withWarmupCosineLRCycles(Float warmupCosineLRCycles) Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'.withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRWarmupEpochs) Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'.withWeightDecay(Float weightDecay) Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ImageModelSettings
public ImageModelSettings()Creates an instance of ImageModelSettings class.
-
-
Method Details
-
amsGradient
Get the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.- Returns:
- the amsGradient value.
-
withAmsGradient
Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.- Parameters:
amsGradient- the amsGradient value to set.- Returns:
- the ImageModelSettings object itself.
-
advancedSettings
Get the advancedSettings property: Settings for advanced scenarios.- Returns:
- the advancedSettings value.
-
withAdvancedSettings
Set the advancedSettings property: Settings for advanced scenarios.- Parameters:
advancedSettings- the advancedSettings value to set.- Returns:
- the ImageModelSettings object itself.
-
augmentations
Get the augmentations property: Settings for using Augmentations.- Returns:
- the augmentations value.
-
withAugmentations
Set the augmentations property: Settings for using Augmentations.- Parameters:
augmentations- the augmentations value to set.- Returns:
- the ImageModelSettings object itself.
-
beta1
Get the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Returns:
- the beta1 value.
-
withBeta1
Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Parameters:
beta1- the beta1 value to set.- Returns:
- the ImageModelSettings object itself.
-
beta2
Get the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Returns:
- the beta2 value.
-
withBeta2
Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].- Parameters:
beta2- the beta2 value to set.- Returns:
- the ImageModelSettings object itself.
-
checkpointFrequency
Get the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer.- Returns:
- the checkpointFrequency value.
-
withCheckpointFrequency
Set the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer.- Parameters:
checkpointFrequency- the checkpointFrequency value to set.- Returns:
- the ImageModelSettings object itself.
-
checkpointRunId
Get the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.- Returns:
- the checkpointRunId value.
-
withCheckpointRunId
Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.- Parameters:
checkpointRunId- the checkpointRunId value to set.- Returns:
- the ImageModelSettings object itself.
-
checkpointModel
Get the checkpointModel property: The pretrained checkpoint model for incremental training.- Returns:
- the checkpointModel value.
-
withCheckpointModel
Set the checkpointModel property: The pretrained checkpoint model for incremental training.- Parameters:
checkpointModel- the checkpointModel value to set.- Returns:
- the ImageModelSettings object itself.
-
distributed
Get the distributed property: Whether to use distributed training.- Returns:
- the distributed value.
-
withDistributed
Set the distributed property: Whether to use distributed training.- Parameters:
distributed- the distributed value to set.- Returns:
- the ImageModelSettings object itself.
-
earlyStopping
Get the earlyStopping property: Enable early stopping logic during training.- Returns:
- the earlyStopping value.
-
withEarlyStopping
Set the earlyStopping property: Enable early stopping logic during training.- Parameters:
earlyStopping- the earlyStopping value to set.- Returns:
- the ImageModelSettings object itself.
-
earlyStoppingDelay
Get 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.- Returns:
- the earlyStoppingDelay value.
-
withEarlyStoppingDelay
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.- Parameters:
earlyStoppingDelay- the earlyStoppingDelay value to set.- Returns:
- the ImageModelSettings object itself.
-
earlyStoppingPatience
Get 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.- Returns:
- the earlyStoppingPatience value.
-
withEarlyStoppingPatience
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.- Parameters:
earlyStoppingPatience- the earlyStoppingPatience value to set.- Returns:
- the ImageModelSettings object itself.
-
evaluationFrequency
Get the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.- Returns:
- the evaluationFrequency value.
-
withEvaluationFrequency
Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.- Parameters:
evaluationFrequency- the evaluationFrequency value to set.- Returns:
- the ImageModelSettings object itself.
-
enableOnnxNormalization
Get the enableOnnxNormalization property: Enable normalization when exporting ONNX model.- Returns:
- the enableOnnxNormalization value.
-
withEnableOnnxNormalization
Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.- Parameters:
enableOnnxNormalization- the enableOnnxNormalization value to set.- Returns:
- the ImageModelSettings object itself.
-
gradientAccumulationStep
Get 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.- Returns:
- the gradientAccumulationStep value.
-
withGradientAccumulationStep
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.- Parameters:
gradientAccumulationStep- the gradientAccumulationStep value to set.- Returns:
- the ImageModelSettings object itself.
-
layersToFreeze
Get 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.- Returns:
- the layersToFreeze value.
-
withLayersToFreeze
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.- Parameters:
layersToFreeze- the layersToFreeze value to set.- Returns:
- the ImageModelSettings object itself.
-
learningRate
Get the learningRate property: Initial learning rate. Must be a float in the range [0, 1].- Returns:
- the learningRate value.
-
withLearningRate
Set the learningRate property: Initial learning rate. Must be a float in the range [0, 1].- Parameters:
learningRate- the learningRate value to set.- Returns:
- the ImageModelSettings object itself.
-
learningRateScheduler
Get the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.- Returns:
- the learningRateScheduler value.
-
withLearningRateScheduler
Set the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.- Parameters:
learningRateScheduler- the learningRateScheduler value to set.- Returns:
- the ImageModelSettings object itself.
-
modelName
Get 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.- Returns:
- the modelName value.
-
withModelName
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.- Parameters:
modelName- the modelName value to set.- Returns:
- the ImageModelSettings object itself.
-
momentum
Get the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1].- Returns:
- the momentum value.
-
withMomentum
Set the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1].- Parameters:
momentum- the momentum value to set.- Returns:
- the ImageModelSettings object itself.
-
nesterov
Get the nesterov property: Enable nesterov when optimizer is 'sgd'.- Returns:
- the nesterov value.
-
withNesterov
Set the nesterov property: Enable nesterov when optimizer is 'sgd'.- Parameters:
nesterov- the nesterov value to set.- Returns:
- the ImageModelSettings object itself.
-
numberOfEpochs
Get the numberOfEpochs property: Number of training epochs. Must be a positive integer.- Returns:
- the numberOfEpochs value.
-
withNumberOfEpochs
Set the numberOfEpochs property: Number of training epochs. Must be a positive integer.- Parameters:
numberOfEpochs- the numberOfEpochs value to set.- Returns:
- the ImageModelSettings object itself.
-
numberOfWorkers
Get the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.- Returns:
- the numberOfWorkers value.
-
withNumberOfWorkers
Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.- Parameters:
numberOfWorkers- the numberOfWorkers value to set.- Returns:
- the ImageModelSettings object itself.
-
optimizer
Get the optimizer property: Type of optimizer.- Returns:
- the optimizer value.
-
withOptimizer
Set the optimizer property: Type of optimizer.- Parameters:
optimizer- the optimizer value to set.- Returns:
- the ImageModelSettings object itself.
-
randomSeed
Get the randomSeed property: Random seed to be used when using deterministic training.- Returns:
- the randomSeed value.
-
withRandomSeed
Set the randomSeed property: Random seed to be used when using deterministic training.- Parameters:
randomSeed- the randomSeed value to set.- Returns:
- the ImageModelSettings object itself.
-
stepLRGamma
Get the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1].- Returns:
- the stepLRGamma value.
-
withStepLRGamma
Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1].- Parameters:
stepLRGamma- the stepLRGamma value to set.- Returns:
- the ImageModelSettings object itself.
-
stepLRStepSize
Get the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive integer.- Returns:
- the stepLRStepSize value.
-
withStepLRStepSize
Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive integer.- Parameters:
stepLRStepSize- the stepLRStepSize value to set.- Returns:
- the ImageModelSettings object itself.
-
trainingBatchSize
Get the trainingBatchSize property: Training batch size. Must be a positive integer.- Returns:
- the trainingBatchSize value.
-
withTrainingBatchSize
Set the trainingBatchSize property: Training batch size. Must be a positive integer.- Parameters:
trainingBatchSize- the trainingBatchSize value to set.- Returns:
- the ImageModelSettings object itself.
-
validationBatchSize
Get the validationBatchSize property: Validation batch size. Must be a positive integer.- Returns:
- the validationBatchSize value.
-
withValidationBatchSize
Set the validationBatchSize property: Validation batch size. Must be a positive integer.- Parameters:
validationBatchSize- the validationBatchSize value to set.- Returns:
- the ImageModelSettings object itself.
-
warmupCosineLRCycles
Get the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1].- Returns:
- the warmupCosineLRCycles value.
-
withWarmupCosineLRCycles
Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1].- Parameters:
warmupCosineLRCycles- the warmupCosineLRCycles value to set.- Returns:
- the ImageModelSettings object itself.
-
warmupCosineLRWarmupEpochs
Get the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer.- Returns:
- the warmupCosineLRWarmupEpochs value.
-
withWarmupCosineLRWarmupEpochs
Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer.- Parameters:
warmupCosineLRWarmupEpochs- the warmupCosineLRWarmupEpochs value to set.- Returns:
- the ImageModelSettings object itself.
-
weightDecay
Get the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1].- Returns:
- the weightDecay value.
-
withWeightDecay
Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1].- Parameters:
weightDecay- the weightDecay value to set.- Returns:
- the ImageModelSettings object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ImageModelSettings>- Throws:
IOException
-
fromJson
Reads an instance of ImageModelSettings from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ImageModelSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the ImageModelSettings.
-