Class ImageModelDistributionSettings

  • Direct Known Subclasses:
    ImageModelDistributionSettingsClassification, ImageModelDistributionSettingsObjectDetection

    public class ImageModelDistributionSettings
    extends Object
    Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, 2)"; </code></example> All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc 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.
    • Constructor Detail

      • ImageModelDistributionSettings

        public ImageModelDistributionSettings()
    • Method Detail

      • amsGradient

        public String amsGradient()
        Get the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.
        Returns:
        the amsGradient value.
      • withAmsGradient

        public ImageModelDistributionSettings withAmsGradient​(String amsGradient)
        Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'.
        Parameters:
        amsGradient - the amsGradient value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • augmentations

        public String augmentations()
        Get the augmentations property: Settings for using Augmentations.
        Returns:
        the augmentations value.
      • withAugmentations

        public ImageModelDistributionSettings withAugmentations​(String augmentations)
        Set the augmentations property: Settings for using Augmentations.
        Parameters:
        augmentations - the augmentations value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • beta1

        public String 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

        public ImageModelDistributionSettings withBeta1​(String beta1)
        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 ImageModelDistributionSettings object itself.
      • beta2

        public String 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

        public ImageModelDistributionSettings withBeta2​(String beta2)
        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 ImageModelDistributionSettings object itself.
      • distributed

        public String distributed()
        Get the distributed property: Whether to use distributer training.
        Returns:
        the distributed value.
      • withDistributed

        public ImageModelDistributionSettings withDistributed​(String distributed)
        Set the distributed property: Whether to use distributer training.
        Parameters:
        distributed - the distributed value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • earlyStopping

        public String earlyStopping()
        Get the earlyStopping property: Enable early stopping logic during training.
        Returns:
        the earlyStopping value.
      • withEarlyStopping

        public ImageModelDistributionSettings withEarlyStopping​(String earlyStopping)
        Set the earlyStopping property: Enable early stopping logic during training.
        Parameters:
        earlyStopping - the earlyStopping value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • earlyStoppingDelay

        public String 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

        public ImageModelDistributionSettings withEarlyStoppingDelay​(String 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.
        Parameters:
        earlyStoppingDelay - the earlyStoppingDelay value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • earlyStoppingPatience

        public String 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

        public ImageModelDistributionSettings withEarlyStoppingPatience​(String 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.
        Parameters:
        earlyStoppingPatience - the earlyStoppingPatience value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • enableOnnxNormalization

        public String enableOnnxNormalization()
        Get the enableOnnxNormalization property: Enable normalization when exporting ONNX model.
        Returns:
        the enableOnnxNormalization value.
      • withEnableOnnxNormalization

        public ImageModelDistributionSettings withEnableOnnxNormalization​(String enableOnnxNormalization)
        Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.
        Parameters:
        enableOnnxNormalization - the enableOnnxNormalization value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • evaluationFrequency

        public String evaluationFrequency()
        Get the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.
        Returns:
        the evaluationFrequency value.
      • withEvaluationFrequency

        public ImageModelDistributionSettings withEvaluationFrequency​(String evaluationFrequency)
        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 ImageModelDistributionSettings object itself.
      • gradientAccumulationStep

        public String 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

        public ImageModelDistributionSettings withGradientAccumulationStep​(String 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.
        Parameters:
        gradientAccumulationStep - the gradientAccumulationStep value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • layersToFreeze

        public String 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

        public ImageModelDistributionSettings withLayersToFreeze​(String 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.
        Parameters:
        layersToFreeze - the layersToFreeze value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • learningRate

        public String learningRate()
        Get the learningRate property: Initial learning rate. Must be a float in the range [0, 1].
        Returns:
        the learningRate value.
      • withLearningRate

        public ImageModelDistributionSettings withLearningRate​(String learningRate)
        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 ImageModelDistributionSettings object itself.
      • learningRateScheduler

        public String learningRateScheduler()
        Get the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.
        Returns:
        the learningRateScheduler value.
      • withLearningRateScheduler

        public ImageModelDistributionSettings withLearningRateScheduler​(String learningRateScheduler)
        Set the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.
        Parameters:
        learningRateScheduler - the learningRateScheduler value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • modelName

        public String 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

        public ImageModelDistributionSettings 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.
        Parameters:
        modelName - the modelName value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • momentum

        public String 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

        public ImageModelDistributionSettings withMomentum​(String momentum)
        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 ImageModelDistributionSettings object itself.
      • nesterov

        public String nesterov()
        Get the nesterov property: Enable nesterov when optimizer is 'sgd'.
        Returns:
        the nesterov value.
      • withNesterov

        public ImageModelDistributionSettings withNesterov​(String nesterov)
        Set the nesterov property: Enable nesterov when optimizer is 'sgd'.
        Parameters:
        nesterov - the nesterov value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • numberOfEpochs

        public String numberOfEpochs()
        Get the numberOfEpochs property: Number of training epochs. Must be a positive integer.
        Returns:
        the numberOfEpochs value.
      • withNumberOfEpochs

        public ImageModelDistributionSettings withNumberOfEpochs​(String numberOfEpochs)
        Set the numberOfEpochs property: Number of training epochs. Must be a positive integer.
        Parameters:
        numberOfEpochs - the numberOfEpochs value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • numberOfWorkers

        public String numberOfWorkers()
        Get the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.
        Returns:
        the numberOfWorkers value.
      • withNumberOfWorkers

        public ImageModelDistributionSettings withNumberOfWorkers​(String numberOfWorkers)
        Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.
        Parameters:
        numberOfWorkers - the numberOfWorkers value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • optimizer

        public String optimizer()
        Get the optimizer property: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'.
        Returns:
        the optimizer value.
      • withOptimizer

        public ImageModelDistributionSettings withOptimizer​(String optimizer)
        Set the optimizer property: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'.
        Parameters:
        optimizer - the optimizer value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • randomSeed

        public String randomSeed()
        Get the randomSeed property: Random seed to be used when using deterministic training.
        Returns:
        the randomSeed value.
      • withRandomSeed

        public ImageModelDistributionSettings withRandomSeed​(String randomSeed)
        Set the randomSeed property: Random seed to be used when using deterministic training.
        Parameters:
        randomSeed - the randomSeed value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • splitRatio

        public String splitRatio()
        Get 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].
        Returns:
        the splitRatio value.
      • withSplitRatio

        public ImageModelDistributionSettings withSplitRatio​(String 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].
        Parameters:
        splitRatio - the splitRatio value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • stepLRGamma

        public String 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

        public ImageModelDistributionSettings withStepLRGamma​(String stepLRGamma)
        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 ImageModelDistributionSettings object itself.
      • stepLRStepSize

        public String 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

        public ImageModelDistributionSettings withStepLRStepSize​(String stepLRStepSize)
        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 ImageModelDistributionSettings object itself.
      • trainingBatchSize

        public String trainingBatchSize()
        Get the trainingBatchSize property: Training batch size. Must be a positive integer.
        Returns:
        the trainingBatchSize value.
      • withTrainingBatchSize

        public ImageModelDistributionSettings withTrainingBatchSize​(String trainingBatchSize)
        Set the trainingBatchSize property: Training batch size. Must be a positive integer.
        Parameters:
        trainingBatchSize - the trainingBatchSize value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • validationBatchSize

        public String validationBatchSize()
        Get the validationBatchSize property: Validation batch size. Must be a positive integer.
        Returns:
        the validationBatchSize value.
      • withValidationBatchSize

        public ImageModelDistributionSettings withValidationBatchSize​(String validationBatchSize)
        Set the validationBatchSize property: Validation batch size. Must be a positive integer.
        Parameters:
        validationBatchSize - the validationBatchSize value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • warmupCosineLRCycles

        public String 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

        public ImageModelDistributionSettings withWarmupCosineLRCycles​(String 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].
        Parameters:
        warmupCosineLRCycles - the warmupCosineLRCycles value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • warmupCosineLRWarmupEpochs

        public String 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

        public ImageModelDistributionSettings withWarmupCosineLRWarmupEpochs​(String warmupCosineLRWarmupEpochs)
        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 ImageModelDistributionSettings object itself.
      • weightDecay

        public String 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

        public ImageModelDistributionSettings withWeightDecay​(String 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].
        Parameters:
        weightDecay - the weightDecay value to set.
        Returns:
        the ImageModelDistributionSettings object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.