Skip to content

Commit 8b8af5c

Browse files
authored
Merge pull request #210828 from MadhuM02/AML_Images_doc_corrections
Image Doc Corrections
2 parents b9045af + 5e20924 commit 8b8af5c

File tree

5 files changed

+159
-26
lines changed

5 files changed

+159
-26
lines changed

articles/machine-learning/how-to-auto-train-image-models.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ Once the run completes, you can register the model that was created from the bes
562562
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
563563

564564
```yaml
565-
565+
CLI example not available, please use Python SDK.
566566
```
567567

568568
# [Python SDK](#tab/python)
@@ -737,7 +737,8 @@ For a detailed description on task specific hyperparameters, please refer to [Hy
737737

738738
If you want to use tiling, and want to control tiling behavior, the following parameters are available: `tile_grid_size`, `tile_overlap_ratio` and `tile_predictions_nms_thresh`. For more details on these parameters please check [Train a small object detection model using AutoML](./how-to-use-automl-small-object-detect.md).
739739

740-
740+
### Test the deployment
741+
Please check this [Test the deployment](./tutorial-auto-train-image-models.md#test-the-deployment) section to test the deployment and visualize the detections from the model.
741742

742743

743744
## Example notebooks

articles/machine-learning/reference-automl-images-hyperparameters.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ ms.date: 01/18/2022
1414

1515
# Hyperparameters for computer vision tasks in automated machine learning
1616

17+
[!INCLUDE [dev v2](../../includes/machine-learning-dev-v2.md)]
18+
> [!div class="op_single_selector" title1="Select the version of Azure Machine Learning you are using:"]
19+
> * [v1](v1/reference-automl-images-hyperparameters-v1.md)
20+
> * [v2 (current version)](reference-automl-images-hyperparameters.md)
21+
1722
Learn which hyperparameters are available specifically for computer vision tasks in automated ML experiments.
1823

1924
With support for computer vision tasks, you can control the model algorithm and sweep hyperparameters. These model algorithms and hyperparameters are passed in as the parameter space for the sweep. While many of the hyperparameters exposed are model-agnostic, there are instances where hyperparameters are model-specific or task-specific.
@@ -26,11 +31,11 @@ This table summarizes hyperparameters specific to the `yolov5` algorithm.
2631
| ------------- |-------------|----|
2732
| `validation_metric_type` | Metric computation method to use for validation metrics. <br> Must be `none`, `coco`, `voc`, or `coco_voc`. | `voc` |
2833
| `validation_iou_threshold` | IOU threshold for box matching when computing validation metrics. <br>Must be a float in the range [0.1, 1]. | 0.5 |
29-
| `img_size` | Image size for train and validation. <br> Must be a positive integer. <br> <br> *Note: training run may get into CUDA OOM if the size is too big*. | 640 |
30-
| `model_size` | Model size. <br> Must be `small`, `medium`, `large`, or `xlarge`. <br><br> *Note: training run may get into CUDA OOM if the model size is too big*. | `medium` |
34+
| `image_size` | Image size for train and validation. <br> Must be a positive integer. <br> <br> *Note: training run may get into CUDA OOM if the size is too big*. | 640 |
35+
| `model_size` | Model size. <br> Must be `small`, `medium`, `large`, or `extra_large`. <br><br> *Note: training run may get into CUDA OOM if the model size is too big*. | `medium` |
3136
| `multi_scale` | Enable multi-scale image by varying image size by +/- 50% <br> Must be 0 or 1. <br> <br> *Note: training run may get into CUDA OOM if no sufficient GPU memory*. | 0 |
32-
| `box_score_thresh` | During inference, only return proposals with a score greater than `box_score_thresh`. The score is the multiplication of the objectness score and classification probability. <br> Must be a float in the range [0, 1]. | 0.1 |
33-
| `nms_iou_thresh` | IOU threshold used during inference in non-maximum suppression post processing. <br> Must be a float in the range [0, 1]. | 0.5 |
37+
| `box_score_threshold` | During inference, only return proposals with a score greater than `box_score_threshold`. The score is the multiplication of the objectness score and classification probability. <br> Must be a float in the range [0, 1]. | 0.1 |
38+
| `nms_iou_threshold` | IOU threshold used during inference in non-maximum suppression post processing. <br> Must be a float in the range [0, 1]. | 0.5 |
3439

3540
This table summarizes hyperparameters specific to the `maskrcnn_*` for instance segmentation during inference.
3641

@@ -50,12 +55,12 @@ The following table describes the hyperparameters that are model agnostic.
5055
| `number_of_epochs` | Number of training epochs. <br>Must be a positive integer. | 15 <br> (except `yolov5`: 30) |
5156
| `training_batch_size` | Training batch size.<br> Must be a positive integer. | Multi-class/multi-label: 78 <br>(except *vit-variants*: <br> `vits16r224`: 128 <br>`vitb16r224`: 48 <br>`vitl16r224`:10)<br><br>Object detection: 2 <br>(except `yolov5`: 16) <br><br> Instance segmentation: 2 <br> <br> *Note: The defaults are largest batch size that can be used on 12 GiB GPU memory*.|
5257
| `validation_batch_size` | Validation batch size.<br> Must be a positive integer. | Multi-class/multi-label: 78 <br>(except *vit-variants*: <br> `vits16r224`: 128 <br>`vitb16r224`: 48 <br>`vitl16r224`:10)<br><br>Object detection: 1 <br>(except `yolov5`: 16) <br><br> Instance segmentation: 1 <br> <br> *Note: The defaults are largest batch size that can be used on 12 GiB GPU memory*.|
53-
| `grad_accumulation_step` | Gradient accumulation means running a configured number of `grad_accumulation_step` without updating the model weights while accumulating the gradients of those steps, and then using the accumulated gradients to compute the weight updates. <br> Must be a positive integer. | 1 |
58+
| `gradient_accumulation_step` | Gradient accumulation means running a configured number of `gradient_accumulation_step` without updating the model weights while accumulating the gradients of those steps, and then using the accumulated gradients to compute the weight updates. <br> Must be a positive integer. | 1 |
5459
| `early_stopping` | Enable early stopping logic during training. <br> Must be 0 or 1.| 1 |
5560
| `early_stopping_patience` | Minimum number of epochs or validation evaluations with<br>no primary metric improvement before the run is stopped.<br> Must be a positive integer. | 5 |
5661
| `early_stopping_delay` | Minimum number of epochs or validation evaluations to wait<br>before primary metric improvement is tracked for early stopping.<br> Must be a positive integer. | 5 |
5762
| `learning_rate` | Initial learning rate. <br>Must be a float in the range [0, 1]. | Multi-class: 0.01 <br>(except *vit-variants*: <br> `vits16r224`: 0.0125<br>`vitb16r224`: 0.0125<br>`vitl16r224`: 0.001) <br><br> Multi-label: 0.035 <br>(except *vit-variants*:<br>`vits16r224`: 0.025<br>`vitb16r224`: 0.025 <br>`vitl16r224`: 0.002) <br><br> Object detection: 0.005 <br>(except `yolov5`: 0.01) <br><br> Instance segmentation: 0.005 |
58-
| `lr_scheduler` | Type of learning rate scheduler. <br> Must be `warmup_cosine` or `step`. | `warmup_cosine` |
63+
| `learning_rate_scheduler` | Type of learning rate scheduler. <br> Must be `warmup_cosine` or `step`. | `warmup_cosine` |
5964
| `step_lr_gamma` | Value of gamma when learning rate scheduler is `step`.<br> Must be a float in the range [0, 1]. | 0.5 |
6065
| `step_lr_step_size` | Value of step size when learning rate scheduler is `step`.<br> Must be a positive integer. | 5 |
6166
| `warmup_cosine_lr_cycles` | Value of cosine cycle when learning rate scheduler is `warmup_cosine`. <br> Must be a float in the range [0, 1]. | 0.45 |
@@ -66,12 +71,10 @@ The following table describes the hyperparameters that are model agnostic.
6671
|`nesterov`| Enable `nesterov` when optimizer is `sgd`. <br> Must be 0 or 1.| 1 |
6772
|`beta1` | Value of `beta1` when optimizer is `adam` or `adamw`. <br> Must be a float in the range [0, 1]. | 0.9 |
6873
|`beta2` | Value of `beta2` when optimizer is `adam` or `adamw`.<br> Must be a float in the range [0, 1]. | 0.999 |
69-
|`amsgrad` | Enable `amsgrad` when optimizer is `adam` or `adamw`.<br> Must be 0 or 1. | 0 |
74+
|`ams_gradient` | Enable `ams_gradient` when optimizer is `adam` or `adamw`.<br> Must be 0 or 1. | 0 |
7075
|`evaluation_frequency`| Frequency to evaluate validation dataset to get metric scores. <br> Must be a positive integer. | 1 |
7176
|`checkpoint_frequency`| Frequency to store model checkpoints. <br> Must be a positive integer. | Checkpoint at epoch with best primary metric on validation.|
72-
|`checkpoint_run_id`| The run id of the experiment that has a pretrained checkpoint for incremental training.| no default |
73-
|`checkpoint_dataset_id`| FileDataset id containing pretrained checkpoint(s) for incremental training. Make sure to pass `checkpoint_filename` along with `checkpoint_dataset_id`.| no default |
74-
|`checkpoint_filename`| The pretrained checkpoint filename in FileDataset for incremental training. Make sure to pass `checkpoint_dataset_id` along with `checkpoint_filename`.| no default |
77+
|`checkpoint_run_id`| The run ID of the experiment that has a pretrained checkpoint for incremental training.| no default |
7578
|`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. <br> Must be a positive integer. <br><br>`'resnet': [('conv1.', 'bn1.'), 'layer1.', 'layer2.', 'layer3.', 'layer4.'],`<br>`'mobilenetv2': ['features.0.', 'features.1.', 'features.2.', 'features.3.', 'features.4.', 'features.5.', 'features.6.', 'features.7.', 'features.8.', 'features.9.', 'features.10.', 'features.11.', 'features.12.', 'features.13.', 'features.14.', 'features.15.', 'features.16.', 'features.17.', 'features.18.'],`<br>`'seresnext': ['layer0.', 'layer1.', 'layer2.', 'layer3.', 'layer4.'],`<br>`'vit': ['patch_embed', 'blocks.0.', 'blocks.1.', 'blocks.2.', 'blocks.3.', 'blocks.4.', 'blocks.5.', 'blocks.6.','blocks.7.', 'blocks.8.', 'blocks.9.', 'blocks.10.', 'blocks.11.'],`<br>`'yolov5_backbone': ['model.0.', 'model.1.', 'model.2.', 'model.3.', 'model.4.','model.5.', 'model.6.', 'model.7.', 'model.8.', 'model.9.'],`<br>`'resnet_backbone': ['backbone.body.conv1.', 'backbone.body.layer1.', 'backbone.body.layer2.','backbone.body.layer3.', 'backbone.body.layer4.']` | no default |
7679

7780
## Image classification (multi-class and multi-label) specific hyperparameters
@@ -80,30 +83,30 @@ The following table summarizes hyperparmeters for image classification (multi-cl
8083

8184
| Parameter name | Description | Default |
8285
| ------------- |-------------|-----|
83-
| `weighted_loss` | 0 for no weighted loss.<br>1 for weighted loss with sqrt.(class_weights) <br> 2 for weighted loss with class_weights. <br> Must be 0 or 1 or 2. | 0 |
84-
| `valid_resize_size` | Image size to which to resize before cropping for validation dataset. <br> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> Training run may get into CUDA OOM if the size is too big*. | 256  |
85-
| `valid_crop_size` | Image crop size that's input to your neural network for validation dataset. <br> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> *ViT-variants* should have the same `valid_crop_size` and `train_crop_size`. <li> Training run may get into CUDA OOM if the size is too big*. | 224 |
86-
| `train_crop_size` | Image crop size that's input to your neural network for train dataset. <br> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> *ViT-variants* should have the same `valid_crop_size` and `train_crop_size`. <li> Training run may get into CUDA OOM if the size is too big*. | 224 |
86+
| `weighted_loss` | <li> 0 for no weighted loss. <li> 1 for weighted loss with sqrt.(class_weights) <li> 2 for weighted loss with class_weights. <li> Must be 0 or 1 or 2. | 0 |
87+
| `validation_resize_size` | <li> Image size to which to resize before cropping for validation dataset. <li> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> Training run may get into CUDA OOM if the size is too big*. | 256  |
88+
| `validation_crop_size` | <li> Image crop size that's input to your neural network for validation dataset. <li> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> *ViT-variants* should have the same `validation_crop_size` and `training_crop_size`. <li> Training run may get into CUDA OOM if the size is too big*. | 224 |
89+
| `training_crop_size` | <li> Image crop size that's input to your neural network for train dataset. <li> Must be a positive integer. <br> <br> *Notes: <li> `seresnext` doesn't take an arbitrary size. <li> *ViT-variants* should have the same `validation_crop_size` and `training_crop_size`. <li> Training run may get into CUDA OOM if the size is too big*. | 224 |
8790

8891
## Object detection and instance segmentation task specific hyperparameters
8992

9093
The following hyperparameters are for object detection and instance segmentation tasks.
9194

9295
> [!WARNING]
93-
> These parameters are not supported with the `yolov5` algorithm. See the [model specific hyperparameters](#model-specific-hyperparameters) section for `yolo5` supported hyperparmeters.
96+
> These parameters are not supported with the `yolov5` algorithm. See the [model specific hyperparameters](#model-specific-hyperparameters) section for `yolov5` supported hyperparmeters.
9497
9598
| Parameter name | Description | Default |
9699
| ------------- |-------------|-----|
97100
| `validation_metric_type` | Metric computation method to use for validation metrics. <br> Must be `none`, `coco`, `voc`, or `coco_voc`. | `voc` |
98101
| `validation_iou_threshold` | IOU threshold for box matching when computing validation metrics. <br>Must be a float in the range [0.1, 1]. | 0.5 |
99102
| `min_size` | Minimum size of the image to be rescaled before feeding it to the backbone. <br> Must be a positive integer. <br> <br> *Note: training run may get into CUDA OOM if the size is too big*.| 600 |
100103
| `max_size` | Maximum size of the image to be rescaled before feeding it to the backbone. <br> Must be a positive integer.<br> <br> *Note: training run may get into CUDA OOM if the size is too big*. | 1333 |
101-
| `box_score_thresh` | During inference, only return proposals with a classification score greater than `box_score_thresh`. <br> Must be a float in the range [0, 1].| 0.3 |
102-
| `nms_iou_thresh` | IOU (intersection over union) threshold used in non-maximum suppression (NMS) for the prediction head. Used during inference. <br>Must be a float in the range [0, 1]. | 0.5 |
103-
| `box_detections_per_img` | Maximum number of detections per image, for all classes. <br> Must be a positive integer.| 100 |
104+
| `box_score_threshold` | During inference, only return proposals with a classification score greater than `box_score_threshold`. <br> Must be a float in the range [0, 1].| 0.3 |
105+
| `nms_iou_threshold` | IOU (intersection over union) threshold used in non-maximum suppression (NMS) for the prediction head. Used during inference. <br>Must be a float in the range [0, 1]. | 0.5 |
106+
| `box_detections_per_image` | Maximum number of detections per image, for all classes. <br> Must be a positive integer.| 100 |
104107
| `tile_grid_size` | The grid size to use for tiling each image. <br>*Note: tile_grid_size must not be None to enable [small object detection](how-to-use-automl-small-object-detect.md) logic*<br> A tuple of two integers passed as a string. Example: --tile_grid_size "(3, 2)" | No Default |
105108
| `tile_overlap_ratio` | Overlap ratio between adjacent tiles in each dimension. <br> Must be float in the range of [0, 1) | 0.25 |
106-
| `tile_predictions_nms_thresh` | The IOU threshold to use to perform NMS while merging predictions from tiles and image. Used in validation/ inference. <br> Must be float in the range of [0, 1] | 0.25 |
109+
| `tile_predictions_nms_threshold` | The IOU threshold to use to perform NMS while merging predictions from tiles and image. Used in validation/ inference. <br> Must be float in the range of [0, 1] | 0.25 |
107110

108111
## Next steps
109112

articles/machine-learning/tutorial-auto-train-image-models.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,16 @@ When doing a hyperparameter sweep, it can be useful to visualize the different c
395395

396396
Alternatively, here below you can see directly the HyperDrive parent run and navigate to its 'Child runs' tab:
397397

398-
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
398+
# [Azure CLI](#tab/cli)
399+
400+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
401+
```yaml
402+
CLI example not available, please use Python SDK.
403+
```
404+
405+
406+
# [Python SDK](#tab/python)
407+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
399408

400409
```python
401410
hd_job = ml_client.jobs.get(returned_job.name + '_HD')
@@ -415,7 +424,7 @@ Once the run completes, you can register the model that was created from the bes
415424

416425
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
417426
```yaml
418-
to be supported
427+
CLI example not available, please use Python SDK.
419428
```
420429

421430

@@ -561,7 +570,7 @@ az ml online-endpoint update --name 'od-fridge-items-endpoint' --traffic 'od-fri
561570

562571
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
563572
```yaml
564-
573+
CLI example not available, please use Python SDK.
565574
```
566575

567576
# [Python SDK](#tab/python)
@@ -581,7 +590,7 @@ Now that you have scored a test image, you can visualize the bounding boxes for
581590

582591
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
583592
```yaml
584-
593+
CLI example not available, please use Python SDK.
585594
```
586595

587596
# [Python SDK](#tab/python)

0 commit comments

Comments
 (0)