Skip to content

Commit 3abb64a

Browse files
Merge pull request #210655 from MadhuM02/limit_setting_changes
limit_settings_changes
2 parents 4d380ac + 4f4e411 commit 3abb64a

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,25 @@ The primary metric used for model optimization and hyperparameter tuning depends
330330
* `mean_average_precision` for IMAGE_OBJECT_DETECTION
331331
* `mean_average_precision` for IMAGE_INSTANCE_SEGMENTATION
332332

333-
### Experiment budget
333+
### Job Limits
334+
335+
You can control the resources spent on your AutoML Image training job by specifying the `timeout_minutes`, `max_trials` and the `max_concurrent_trials` for the job in limit settings as described in the below example.
336+
337+
Parameter | Detail
338+
-----|----
339+
`max_trials` | Parameter for maximum number of configurations to sweep. Must be an integer between 1 and 1000. When exploring just the default hyperparameters for a given model algorithm, set this parameter to 1. default value is 1.
340+
`max_concurrent_trials`| Maximum number of runs that can run concurrently. If not specified, all runs launch in parallel. If specified, must be an integer between 1 and 100. <br><br> **NOTE:** The number of concurrent runs is gated on the resources available in the specified compute target. Ensure that the compute target has the available resources for the desired concurrency. default value is 1.
341+
`timeout_minutes`| The amount of time in minutes before the experiment terminates. If none specified, default experiment timeout_minutes is seven days (maximum 60 days)
334342

335-
You can optionally specify the maximum time budget for your AutoML Vision training job using the `timeout` parameter in the `limits` - the amount of time in minutes before the experiment terminates. If none specified, default experiment timeout is seven days (maximum 60 days). For example,
336343
# [Azure CLI](#tab/cli)
337344

338345
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
339346

340347
```yaml
341348
limits:
342-
timeout: 60
349+
timeout_minutes: 60
350+
max_trials: 10
351+
max_concurrent_trials: 2
343352
```
344353

345354
# [Python SDK](#tab/python)
@@ -429,16 +438,9 @@ You can automatically end poorly performing runs with an early termination polic
429438

430439
Learn more about [how to configure the early termination policy for your hyperparameter sweep](how-to-tune-hyperparameters.md#early-termination).
431440

432-
### Resources for the sweep
433-
434-
You can control the resources spent on your hyperparameter sweep by specifying the `max_trials` and the `max_concurrent_trials` for the sweep.
435441
> [!NOTE]
436442
> For a complete sweep configuration sample, please refer to this [tutorial](tutorial-auto-train-image-models.md#hyperparameter-sweeping-for-image-tasks).
437443

438-
Parameter | Detail
439-
-----|----
440-
`max_trials` | Required parameter for maximum number of configurations to sweep. Must be an integer between 1 and 1000. When exploring just the default hyperparameters for a given model algorithm, set this parameter to 1.
441-
`max_concurrent_trials`| Maximum number of runs that can run concurrently. If not specified, all runs launch in parallel. If specified, must be an integer between 1 and 100. <br><br> **NOTE:** The number of concurrent runs is gated on the resources available in the specified compute target. Ensure that the compute target has the available resources for the desired concurrency.
442444

443445
You can configure all the sweep related parameters as shown in the example below.
444446

@@ -448,9 +450,6 @@ You can configure all the sweep related parameters as shown in the example below
448450

449451
```yaml
450452
sweep:
451-
limits:
452-
max_trials: 10
453-
max_concurrent_trials: 2
454453
sampling_algorithm: random
455454
early_termination:
456455
type: bandit

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,33 @@ In your AutoML job, you can specify the model algorithms by using `model_name` p
322322

323323
In this example, we will train an object detection model with `yolov5` and `fasterrcnn_resnet50_fpn`, both of which are pretrained on COCO, a large-scale object detection, segmentation, and captioning dataset that contains over thousands of labeled images with over 80 label categories.
324324

325+
### Job Limits
326+
327+
You can control the resources spent on your AutoML Image training job by specifying the `timeout_minutes`, `max_trials` and the `max_concurrent_trials` for the job in limit settings. PLease refer to [detailed description on Job Limits parameters](./how-to-auto-train-image-models.md#job-limits).
328+
# [Azure CLI](#tab/cli)
329+
330+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
331+
332+
```yaml
333+
limits:
334+
timeout_minutes: 60
335+
max_trials: 10
336+
max_concurrent_trials: 2
337+
```
338+
339+
# [Python SDK](#tab/python)
340+
341+
[!Notebook-python[] (~/azureml-examples-main/sdk/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items/automl-image-object-detection-task-fridge-items.ipynb?name=limit-settings)]
342+
---
343+
344+
325345
### Hyperparameter sweeping for image tasks
326346

327347
You can perform a hyperparameter sweep over a defined search space to find the optimal model.
328348

329349
The following code, defines the search space in preparation for the hyperparameter sweep for each defined algorithm, `yolov5` and `fasterrcnn_resnet50_fpn`. In the search space, specify the range of values for `learning_rate`, `optimizer`, `lr_scheduler`, etc., for AutoML to choose from as it attempts to generate a model with the optimal primary metric. If hyperparameter values are not specified, then default values are used for each algorithm.
330350

331-
For the tuning settings, use random sampling to pick samples from this parameter space by using the `random` sampling_algorithm. Doing so, tells automated ML to try a total of 10 trials with these different samples, running two trials at a time on our compute target, which was set up using four nodes. The more parameters the search space has, the more trials you need to find optimal models.
351+
For the tuning settings, use random sampling to pick samples from this parameter space by using the `random` sampling_algorithm. The job limits configured above, tells automated ML to try a total of 10 trials with these different samples, running two trials at a time on our compute target, which was set up using four nodes. The more parameters the search space has, the more trials you need to find optimal models.
332352

333353
The Bandit early termination policy is also used. This policy terminates poor performing configurations; that is, those configurations that are not within 20% slack of the best performing configuration, which significantly saves compute resources.
334354

@@ -338,9 +358,6 @@ The Bandit early termination policy is also used. This policy terminates poor pe
338358

339359
```yaml
340360
sweep:
341-
limits:
342-
max_trials: 10
343-
max_concurrent_trials: 2
344361
sampling_algorithm: random
345362
early_termination:
346363
type: bandit

0 commit comments

Comments
 (0)