Skip to content

Commit a47d4e8

Browse files
committed
standardize Python/CLI tabs
1 parent 12ef639 commit a47d4e8

5 files changed

+123
-59
lines changed

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

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ Automated ML supports model training for computer vision tasks like image classi
2929

3030
## Prerequisites
3131

32-
# [CLI v2](#tab/CLI-v2)
32+
# [Azure CLI](#tab/cli)
3333

3434
* An Azure Machine Learning workspace. To create the workspace, see [Create workspace resources](quickstart-create-resources.md).
3535
* Install and [set up CLI (v2)](how-to-configure-cli.md#prerequisites) and make sure you install the `ml` extension.
3636

37-
# [Python SDK v2 (preview)](#tab/SDK-v2)
37+
# [Python SDK](#tab/python)
38+
39+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
40+
3841
* An Azure Machine Learning workspace. To create the workspace, see [Create workspace resources](quickstart-create-resources.md).
3942

4043
* The Azure Machine Learning Python SDK v2 (preview) installed.
@@ -68,7 +71,7 @@ image classification multi-label | CLI v2: `image_classification_multilabel` <br
6871
image object detection | CLI v2: `image_object_detection` <br> SDK v2: `image_object_detection()`
6972
image instance segmentation| CLI v2: `image_instance_segmentation` <br> SDK v2: `image_instance_segmentation()`
7073

71-
# [CLI v2](#tab/CLI-v2)
74+
# [Azure CLI](#tab/cli)
7275

7376
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
7477

@@ -80,7 +83,10 @@ For example:
8083
task: image_object_detection
8184
```
8285

83-
# [Python SDK v2 (preview)](#tab/SDK-v2)
86+
# [Python SDK](#tab/python)
87+
88+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
89+
8490
Based on the task type, you can create automl image jobs using task specific `automl` functions.
8591

8692
For example:
@@ -189,7 +195,7 @@ Once your data is in JSONL format, you can create training and validation `MLTab
189195

190196
Automated ML doesn't impose any constraints on training or validation data size for computer vision tasks. Maximum dataset size is only limited by the storage layer behind the dataset (i.e. blob store). There's no minimum number of images or labels. However, we recommend starting with a minimum of 10-15 samples per label to ensure the output model is sufficiently trained. The higher the total number of labels/classes, the more samples you need per label.
191197

192-
# [CLI v2](#tab/CLI-v2)
198+
# [Azure CLI](#tab/cli)
193199

194200
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
195201

@@ -207,7 +213,9 @@ validation_data:
207213
type: mltable
208214
```
209215

210-
# [Python SDK v2 (preview)](#tab/SDK-v2)
216+
# [Python SDK](#tab/python)
217+
218+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
211219

212220
You can create data inputs from training and validation MLTable from your local directory or cloud storage with the following code:
213221

@@ -233,15 +241,17 @@ Provide a [compute target](concept-azure-machine-learning-architecture.md#comput
233241

234242
The compute target is passed in using the `compute` parameter. For example:
235243

236-
# [CLI v2](#tab/CLI-v2)
244+
# [Azure CLI](#tab/cli)
237245

238246
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
239247

240248
```yaml
241249
compute: azureml:gpu-cluster
242250
```
243251

244-
# [Python SDK v2 (preview)](#tab/SDK-v2)
252+
# [Python SDK](#tab/python)
253+
254+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
245255

246256
```python
247257
from azure.ai.ml import automl
@@ -286,7 +296,7 @@ In general, deep learning model performance can often improve with more data. Da
286296

287297
Before doing a large sweep to search for the optimal models and hyperparameters, we recommend trying the default values to get a first baseline. Next, you can explore multiple hyperparameters for the same model before sweeping over multiple models and their parameters. This way, you can employ a more iterative approach, because with multiple models and multiple hyperparameters for each, the search space grows exponentially and you need more iterations to find optimal configurations.
288298

289-
# [CLI v2](#tab/CLI-v2)
299+
# [Azure CLI](#tab/cli)
290300

291301
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
292302

@@ -296,7 +306,9 @@ If you wish to use the default hyperparameter values for a given algorithm (say
296306
image_model:
297307
model_name: "yolov5"
298308
```
299-
# [Python SDK v2 (preview)](#tab/SDK-v2)
309+
# [Python SDK](#tab/python)
310+
311+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
300312

301313
If you wish to use the default hyperparameter values for a given algorithm (say yolov5), you can specify it using model_name parameter in set_image_model method of the task specific `automl` job. For example,
302314

@@ -318,7 +330,7 @@ The primary metric used for model optimization and hyperparameter tuning depends
318330
### Experiment budget
319331

320332
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,
321-
# [CLI v2](#tab/CLI-v2)
333+
# [Azure CLI](#tab/cli)
322334

323335
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
324336

@@ -327,7 +339,9 @@ limits:
327339
timeout: 60
328340
```
329341

330-
# [Python SDK v2 (preview)](#tab/SDK-v2)
342+
# [Python SDK](#tab/python)
343+
344+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
331345

332346
[!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)]
333347

@@ -385,7 +399,7 @@ Parameter | Detail
385399

386400
You can configure all the sweep related parameters as shown in the example below.
387401

388-
# [CLI v2](#tab/CLI-v2)
402+
# [Azure CLI](#tab/cli)
389403

390404
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
391405

@@ -402,7 +416,9 @@ sweep:
402416
delay_evaluation: 6
403417
```
404418

405-
# [Python SDK v2 (preview)](#tab/SDK-v2)
419+
# [Python SDK](#tab/python)
420+
421+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
406422

407423
[!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=sweep-settings)]
408424

@@ -413,7 +429,7 @@ sweep:
413429

414430
You can pass fixed settings or parameters that don't change during the parameter space sweep as shown below.
415431

416-
# [CLI v2](#tab/CLI-v2)
432+
# [Azure CLI](#tab/cli)
417433

418434
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
419435

@@ -424,7 +440,9 @@ image_model:
424440
```
425441

426442

427-
# [Python SDK v2 (preview)](#tab/SDK-v2)
443+
# [Python SDK](#tab/python)
444+
445+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
428446

429447
[!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=pass-arguments)]
430448

@@ -440,7 +458,7 @@ Once the training run is done, you have the option to further train the model by
440458

441459
You can pass the run ID that you want to load the checkpoint from.
442460

443-
# [CLI v2](#tab/CLI-v2)
461+
# [Azure CLI](#tab/cli)
444462

445463
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
446464

@@ -450,7 +468,9 @@ image_model:
450468
```
451469

452470

453-
# [Python SDK v2 (preview)](#tab/SDK-v2)
471+
# [Python SDK](#tab/python)
472+
473+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
454474

455475
To find the run ID from the desired model, you can use the following code.
456476

@@ -500,7 +520,7 @@ automl_image_job_incremental = ml_client.jobs.create_or_update(
500520

501521

502522

503-
# [CLI v2](#tab/CLI-v2)
523+
# [Azure CLI](#tab/cli)
504524

505525
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
506526

@@ -510,7 +530,9 @@ To submit your AutoML job, you run the following CLI v2 command with the path to
510530
az ml job create --file ./hello-automl-job-basic.yml --workspace-name [YOUR_AZURE_WORKSPACE] --resource-group [YOUR_AZURE_RESOURCE_GROUP] --subscription [YOUR_AZURE_SUBSCRIPTION]
511531
```
512532

513-
# [Python SDK v2 (preview)](#tab/SDK-v2)
533+
# [Python SDK](#tab/python)
534+
535+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
514536

515537
When you've configured your AutoML Job to the desired settings, you can submit the job.
516538

@@ -540,12 +562,14 @@ You can configure the model deployment endpoint name and the inferencing cluster
540562
![Deploy configuration](./media/how-to-auto-train-image-models/deploy-image-model.png)
541563

542564
## Code examples
543-
# [CLI v2](#tab/CLI-v2)
565+
# [Azure CLI](#tab/cli)
544566

545567
Review detailed code examples and use cases in the [azureml-examples repository for automated machine learning samples](https://github.com/Azure/azureml-examples/tree/sdk-preview/cli/jobs/automl-standalone-jobs).
546568

547569

548-
# [Python SDK v2 (preview)](#tab/SDK-v2)
570+
# [Python SDK](#tab/python)
571+
572+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
549573

550574
Review detailed code examples and use cases in the [GitHub notebook repository for automated machine learning samples](https://github.com/Azure/azureml-examples/tree/sdk-preview/sdk/jobs/automl-standalone-jobs).
551575

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

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can seamlessly integrate with the [Azure Machine Learning data labeling](how
3030

3131
## Prerequisites
3232

33-
# [CLI v2](#tab/CLI-v2)
33+
# [Azure CLI](#tab/cli)
3434

3535
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
3636

@@ -45,7 +45,9 @@ You can seamlessly integrate with the [Azure Machine Learning data labeling](how
4545

4646
* This article assumes some familiarity with setting up an automated machine learning experiment. Follow the [how-to](how-to-configure-auto-train.md) to see the main automated machine learning experiment design patterns.
4747

48-
# [Python SDK v2 (preview)](#tab/SDK-v2)
48+
# [Python SDK](#tab/python)
49+
50+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
4951

5052
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
5153

@@ -180,15 +182,17 @@ However, there are key differences:
180182
* If you enable long range text, then a GPU with higher memory is required such as, [NCv3](../virtual-machines/ncv3-series.md) series or [ND](../virtual-machines/nd-series.md) series.
181183
* The `enable_long_range_text` parameter is only available for multi-class classification tasks.
182184

183-
# [CLI v2](#tab/CLI-v2)
185+
# [Azure CLI](#tab/cli)
184186

185187
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
186188

187189
For CLI v2 AutoML jobs you configure your experiment in a YAML file like the following.
188190

189191

190192

191-
# [Python SDK v2 (preview)](#tab/SDK-v2)
193+
# [Python SDK](#tab/python)
194+
195+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
192196

193197
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
194198

@@ -228,7 +232,7 @@ Multi-label text classification|`"eng"` <br> `"deu"` <br> `"mul"`| English&nbs
228232
Multi-class text classification|`"eng"` <br> `"deu"` <br> `"mul"`| English&nbsp;BERT&nbsp;[cased](https://huggingface.co/bert-base-cased)<br> [Multilingual BERT](https://huggingface.co/bert-base-multilingual-cased) <br><br>For all other languages, automated ML applies multilingual BERT
229233
Named entity recognition (NER)|`"eng"` <br> `"deu"` <br> `"mul"`| English&nbsp;BERT&nbsp;[cased](https://huggingface.co/bert-base-cased) <br> [German BERT](https://huggingface.co/bert-base-german-cased)<br> [Multilingual BERT](https://huggingface.co/bert-base-multilingual-cased) <br><br>For all other languages, automated ML applies multilingual BERT
230234

231-
# [CLI v2](#tab/CLI-v2)
235+
# [Azure CLI](#tab/cli)
232236

233237
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
234238

@@ -239,7 +243,9 @@ featurization:
239243
dataset_language: "eng"
240244
```
241245

242-
# [Python SDK v2 (preview)](#tab/SDK-v2)
246+
# [Python SDK](#tab/python)
247+
248+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
243249

244250
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
245251

@@ -255,12 +261,14 @@ text_classification_job.set_featurization(dataset_language='eng')
255261

256262
You can also run your NLP experiments with distributed training on an Azure ML compute cluster.
257263

258-
# [CLI v2](#tab/CLI-v2)
264+
# [Azure CLI](#tab/cli)
259265

260266
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
261267

262268

263-
# [Python SDK v2 (preview)](#tab/SDK-v2)
269+
# [Python SDK](#tab/python)
270+
271+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
264272

265273
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
266274

@@ -275,7 +283,7 @@ enable_distributed_dnn_training = True
275283

276284
## Submit the AutoML job
277285

278-
# [CLI v2](#tab/CLI-v2)
286+
# [Azure CLI](#tab/cli)
279287

280288
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
281289

@@ -286,7 +294,9 @@ To submit your AutoML job, you can run the following CLI v2 command with the pat
286294
az ml job create --file ./hello-automl-job-basic.yml --workspace-name [YOUR_AZURE_WORKSPACE] --resource-group [YOUR_AZURE_RESOURCE_GROUP] --subscription [YOUR_AZURE_SUBSCRIPTION]
287295
```
288296

289-
# [Python SDK v2 (preview)](#tab/SDK-v2)
297+
# [Python SDK](#tab/python)
298+
299+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
290300

291301
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
292302

@@ -305,15 +315,20 @@ ml_client.jobs.stream(returned_job.name)
305315

306316
## Code examples
307317

308-
# [CLI v2](#tab/CLI-v2)
318+
# [Azure CLI](#tab/cli)
319+
320+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
321+
309322

310323
See the following sample YAML files for each NLP task.
311324

312325
* [Multi-class text classification](https://github.com/Azure/azureml-examples/blob/main/cli/jobs/automl-standalone-jobs/cli-automl-text-classification-newsgroup/cli-automl-text-classification-newsgroup.yml)
313326
* [Multi-label text classification](https://github.com/Azure/azureml-examples/blob/main/cli/jobs/automl-standalone-jobs/cli-automl-text-classification-multilabel-paper-cat/cli-automl-text-classification-multilabel-paper-cat.yml)
314327
* [Named entity recognition](https://github.com/Azure/azureml-examples/blob/main/cli/jobs/automl-standalone-jobs/cli-automl-text-ner-conll/cli-automl-text-ner-conll2003.yml)
315328

316-
# [Python SDK v2 (preview)](#tab/SDK-v2)
329+
# [Python SDK](#tab/python)
330+
331+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
317332

318333
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
319334

articles/machine-learning/how-to-prepare-datasets-for-automl-images.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ms.date: 05/26/2022
1313

1414
# Prepare data for computer vision tasks with automated machine learning (preview)
1515

16-
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
16+
[!INCLUDE [dev v2](../../includes/machine-learning-dev-v2.md)]
1717

18-
> [!div class="op_single_selector" title1="Select the version of Azure Machine Learning CLI extension you are using:"]
18+
> [!div class="op_single_selector" title1="Select the version of Azure Machine Learning you are using:"]
1919
> * [v1](v1/how-to-prepare-datasets-for-automl-images-v1.md)
2020
> * [v2 (current version)](how-to-prepare-datasets-for-automl-images.md)
2121
@@ -50,7 +50,7 @@ If you already have a data labeling project and you want to use that data, you c
5050
### Using pre-labeled training data
5151
If you have previously labeled data that you would like to use to train your model, you will first need to upload the images to the default Azure Blob Storage of your Azure ML Workspace and register it as a data asset.
5252

53-
# [CLI v2](#tab/CLI-v2)
53+
# [Azure CLI](#tab/cli)
5454
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
5555

5656
Create a .yml file with the following configuration.
@@ -69,7 +69,10 @@ To upload the images as a data asset, you run the following CLI v2 command with
6969
az ml data create -f [PATH_TO_YML_FILE] --workspace-name [YOUR_AZURE_WORKSPACE] --resource-group [YOUR_AZURE_RESOURCE_GROUP] --subscription [YOUR_AZURE_SUBSCRIPTION]
7070
```
7171

72-
# [Python SDK v2 (preview)](#tab/SDK-v2)
72+
# [Python SDK](#tab/python)
73+
74+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
75+
7376
[!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=upload-data)]
7477
---
7578

0 commit comments

Comments
 (0)