Class ImageModelSettingsClassification


  • public final class ImageModelSettingsClassification
    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 Detail

      • ImageModelSettingsClassification

        public ImageModelSettingsClassification()
    • Method Detail

      • trainingCropSize

        public Integer trainingCropSize()
        Get the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. Must be a positive integer.
        Returns:
        the trainingCropSize value.
      • withTrainingCropSize

        public ImageModelSettingsClassification withTrainingCropSize​(Integer trainingCropSize)
        Set the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. Must be a positive integer.
        Parameters:
        trainingCropSize - the trainingCropSize value to set.
        Returns:
        the ImageModelSettingsClassification object itself.
      • validationCropSize

        public Integer validationCropSize()
        Get the validationCropSize property: Image crop size that is input to the neural network for the validation dataset. Must be a positive integer.
        Returns:
        the validationCropSize value.
      • withValidationCropSize

        public ImageModelSettingsClassification withValidationCropSize​(Integer validationCropSize)
        Set the validationCropSize property: Image crop size that is input to the neural network for the validation dataset. Must be a positive integer.
        Parameters:
        validationCropSize - the validationCropSize value to set.
        Returns:
        the ImageModelSettingsClassification object itself.
      • validationResizeSize

        public Integer validationResizeSize()
        Get the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must be a positive integer.
        Returns:
        the validationResizeSize value.
      • withValidationResizeSize

        public ImageModelSettingsClassification withValidationResizeSize​(Integer validationResizeSize)
        Set the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must be a positive integer.
        Parameters:
        validationResizeSize - the validationResizeSize value to set.
        Returns:
        the ImageModelSettingsClassification object itself.
      • weightedLoss

        public Integer weightedLoss()
        Get the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2.
        Returns:
        the weightedLoss value.
      • withWeightedLoss

        public ImageModelSettingsClassification withWeightedLoss​(Integer weightedLoss)
        Set the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2.
        Parameters:
        weightedLoss - the weightedLoss value to set.
        Returns:
        the ImageModelSettingsClassification object itself.
      • withBeta1

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        beta1 - the beta1 value to set.
        Returns:
        the ImageModelSettings object itself.
      • withBeta2

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        beta2 - the beta2 value to set.
        Returns:
        the ImageModelSettings object itself.
      • withCheckpointDatasetId

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        checkpointDatasetId - the checkpointDatasetId value to set.
        Returns:
        the ImageModelSettings object itself.
      • withCheckpointFilename

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        checkpointFilename - the checkpointFilename value to set.
        Returns:
        the ImageModelSettings object itself.
      • withCheckpointFrequency

        public ImageModelSettingsClassification withCheckpointFrequency​(Integer checkpointFrequency)
        Set the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer.
        Overrides:
        withCheckpointFrequency in class ImageModelSettings
        Parameters:
        checkpointFrequency - the checkpointFrequency value to set.
        Returns:
        the ImageModelSettings object itself.
      • withCheckpointRunId

        public ImageModelSettingsClassification withCheckpointRunId​(String checkpointRunId)
        Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental training.
        Overrides:
        withCheckpointRunId in class ImageModelSettings
        Parameters:
        checkpointRunId - the checkpointRunId value to set.
        Returns:
        the ImageModelSettings object itself.
      • withEarlyStoppingDelay

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        earlyStoppingDelay - the earlyStoppingDelay value to set.
        Returns:
        the ImageModelSettings object itself.
      • withEarlyStoppingPatience

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        earlyStoppingPatience - the earlyStoppingPatience value to set.
        Returns:
        the ImageModelSettings object itself.
      • withEnableOnnxNormalization

        public ImageModelSettingsClassification withEnableOnnxNormalization​(Boolean enableOnnxNormalization)
        Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model.
        Overrides:
        withEnableOnnxNormalization in class ImageModelSettings
        Parameters:
        enableOnnxNormalization - the enableOnnxNormalization value to set.
        Returns:
        the ImageModelSettings object itself.
      • withEvaluationFrequency

        public ImageModelSettingsClassification withEvaluationFrequency​(Integer evaluationFrequency)
        Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.
        Overrides:
        withEvaluationFrequency in class ImageModelSettings
        Parameters:
        evaluationFrequency - the evaluationFrequency value to set.
        Returns:
        the ImageModelSettings object itself.
      • withGradientAccumulationStep

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        gradientAccumulationStep - the gradientAccumulationStep value to set.
        Returns:
        the ImageModelSettings object itself.
      • withLayersToFreeze

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        layersToFreeze - the layersToFreeze value to set.
        Returns:
        the ImageModelSettings object itself.
      • withLearningRate

        public ImageModelSettingsClassification withLearningRate​(Float learningRate)
        Set the learningRate property: Initial learning rate. Must be a float in the range [0, 1].
        Overrides:
        withLearningRate in class ImageModelSettings
        Parameters:
        learningRate - the learningRate value to set.
        Returns:
        the ImageModelSettings object itself.
      • withModelName

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        modelName - the modelName value to set.
        Returns:
        the ImageModelSettings object itself.
      • withMomentum

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        momentum - the momentum value to set.
        Returns:
        the ImageModelSettings object itself.
      • withNumberOfWorkers

        public ImageModelSettingsClassification withNumberOfWorkers​(Integer numberOfWorkers)
        Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer.
        Overrides:
        withNumberOfWorkers in class ImageModelSettings
        Parameters:
        numberOfWorkers - the numberOfWorkers value to set.
        Returns:
        the ImageModelSettings object itself.
      • withSplitRatio

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        splitRatio - the splitRatio value to set.
        Returns:
        the ImageModelSettings object itself.
      • withStepLRGamma

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        stepLRGamma - the stepLRGamma value to set.
        Returns:
        the ImageModelSettings object itself.
      • withStepLRStepSize

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        stepLRStepSize - the stepLRStepSize value to set.
        Returns:
        the ImageModelSettings object itself.
      • withWarmupCosineLRCycles

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        warmupCosineLRCycles - the warmupCosineLRCycles value to set.
        Returns:
        the ImageModelSettings object itself.
      • withWarmupCosineLRWarmupEpochs

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        warmupCosineLRWarmupEpochs - the warmupCosineLRWarmupEpochs value to set.
        Returns:
        the ImageModelSettings object itself.
      • withWeightDecay

        public ImageModelSettingsClassification 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 class ImageModelSettings
        Parameters:
        weightDecay - the weightDecay value to set.
        Returns:
        the ImageModelSettings object itself.