components train_image_classification_model - Azure/azureml-assets GitHub Wiki

Image Classification AutoML Legacy Model Finetune

train_image_classification_model

Overview

Component to finetune AutoML legacy models for image classification.

Version: 0.0.12

View in Studio: https://ml.azure.com/registries/azureml/components/train_image_classification_model/version/0.0.12

Inputs

Name Description Type Default Optional Enum
training_data Path to MLTable for training data. mltable
validation_data Path to MLTable for validation data. mltable True
task_type Whether a single image can have multiple labels. string ['image-classification', 'image-classification-multilabel']
ams_gradient Enable ams_gradient when optimizer is adam or adamw. boolean True
beta1 Value of beta1 when optimizer is adam or adamw. Must be a float in the range [0, 1]. number True
beta2 Value of beta2 when optimizer is adam or adamw. Must be a float in the range [0, 1]. number True
checkpoint_frequency Frequency to store model checkpoints. Must be a positive integer. integer True
checkpoint_run_id The run ID of the experiment that has a pretrained checkpoint for incremental training. string True
early_stopping Enable early stopping logic during training. boolean True
early_stopping_patience Minimum number of epochs or validation evaluations with no primary metric improvement before the run is stopped. Must be a positive integer. integer True
early_stopping_delay Minimum number of epochs or validation evaluations to wait before primary metric improvement is tracked for early stopping. Must be a positive integer. integer True
evaluation_frequency Frequency to evaluate validation dataset to get metric scores. Must be a positive integer. integer True
gradient_accumulation_step Number of forward passes 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. integer True
layers_to_freeze How many layers to freeze for your model. For instance, passing 2 as value for seresnext means freezing layer0 and layer1 referring to the below supported model layer info. Must be a positive integer. integer True
learning_rate Initial learning rate. number True
learning_rate_scheduler Type of learning rate scheduler. Must be warmup_cosine or step. string warmup_cosine True ['warmup_cosine', 'step']
model_name Model name string True
momentum Value of momentum when optimizer is sgd. Must be a float in the range [0, 1]. number True
nesterov Enable nesterov when optimizer is sgd. boolean True
number_of_epochs Number of training epochs integer True
number_of_workers Number of subprocesses to use for data loading (PyTorch only). 0 means that the data will be loaded in the main process. integer True
optimizer Type of optimizer string sgd True ['sgd', 'adam', 'adamw']
random_seed Random seed that will be set at the beginning of training. integer True
step_lr_gamma Value of gamma when learning rate scheduler is step. Please check for https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters more information. number True
step_lr_step_size Value of step size when learning rate scheduler is step. Please check for https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters more information. integer True
training_batch_size Training batch size. integer True
training_crop_size Image crop size that's input to your neural network for training dataset. Notes - seresnext doesn't take an arbitrary size. ViT-variants should have the same validation_crop_size and training_crop_size. integer True
validation_batch_size Validation batch size. integer True
validation_crop_size Image crop size that's input to your neural network for validation dataset. Note - seresnext doesn't take an arbitrary size. ViT-variants should have the same validation_crop_size and training_crop_size. integer True
validation_resize_size Image size to which to resize before cropping for validation dataset. Note - seresnext doesn't take an arbitrary size. integer True
warmup_cosine_lr_cycles Value of cosine cycle when learning rate scheduler is warmup_cosine. Please check for https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters more information. number True
warmup_cosine_lr_warmup_epochs Value of warmup epochs when learning rate scheduler is warmup_cosine. Please check for https://learn.microsoft.com/azure/machine-learning/reference-automl-images-hyperparameters more information. integer True
weight_decay Value of weight decay used by the optimizer. number True
weighted_loss 0 for no weighted loss, 1 for weighted loss with sqrt (class_weights), 2 for weighted loss with class_weights. integer True

Outputs

Name Description Type
mlflow_model_folder Trained MLFlow model. mlflow_model
pytorch_model_folder Trained Pytorch model. custom_model

Environment

azureml://registries/azureml/environments/automl-dnn-vision-gpu/versions/34

⚠️ **GitHub.com Fallback** ⚠️