Skip to content

Commit f780ded

Browse files
committed
PR updates per human review
1 parent 35bad00 commit f780ded

23 files changed

+69
-66
lines changed

articles/machine-learning/service/how-to-configure-environment.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The DSVM is a customized virtual machine (VM) image. It's designed for data scie
8585

8686
The Azure Machine Learning SDK works on either the Ubuntu or Windows version of the DSVM. But if you plan to use the DSVM as a compute target as well, only Ubuntu is supported.
8787

88-
To use the DSVM as a development environment, do the following:
88+
To use the DSVM as a development environment:
8989

9090
1. Create a DSVM in either of the following environments:
9191

@@ -146,9 +146,9 @@ For more information, see [Data Science Virtual Machines](https://azure.microsof
146146
147147
## <a id="local"></a>Local computer
148148
149-
When you're using a local computer (which might also be a remote virtual machine), create an Anaconda environment and install the SDK by doing the following:
149+
When you're using a local computer (which might also be a remote virtual machine), create an Anaconda environment and install the SDK. Here's an example:
150150
151-
1. Download and install [Anaconda](https://www.anaconda.com/distribution/#download-section) (Python 3.7 version) if you don't already have it.
151+
1. Download and install [Anaconda](https://www.anaconda.com/distribution/#download-section) (Python 3.7 version) if you don't already have it.
152152
153153
1. Open an Anaconda prompt and create an environment with the following commands:
154154
@@ -180,10 +180,10 @@ When you're using a local computer (which might also be a remote virtual machine
180180
181181
1. Use the following commands to install packages:
182182
183-
This command installs the base Azure Machine Learning SDK with notebook and automl extras. The `automl` extra is a large install, and can be removed from the brackets if you don't intend to run automated machine learning experiments. The `automl` extra also includes the Azure Machine Learning Data Prep SDK by default as a dependency.
183+
This command installs the base Azure Machine Learning SDK with notebook and `automl` extras. The `automl` extra is a large install, and can be removed from the brackets if you don't intend to run automated machine learning experiments. The `automl` extra also includes the Azure Machine Learning Data Prep SDK by default as a dependency.
184184
185185
```shell
186-
pip install azureml-sdk[notebooks,automl]
186+
pip install azureml-sdk[notebooks, automl]
187187
```
188188
189189
> [!NOTE]
@@ -216,7 +216,9 @@ When you're using a local computer (which might also be a remote virtual machine
216216
217217
Jupyter Notebooks are part of the [Jupyter Project](https://jupyter.org/). They provide an interactive coding experience where you create documents that mix live code with narrative text and graphics. Jupyter Notebooks are also a great way to share your results with others, because you can save the output of your code sections in the document. You can install Jupyter Notebooks on a variety of platforms.
218218
219-
The procedure in the [Local computer](#local) section installs necessary components for running Jupyter Notebooks in an Anaconda environment. To enable these components in your Jupyter Notebook environment, do the following:
219+
The procedure in the [Local computer](#local) section installs necessary components for running Jupyter Notebooks in an Anaconda environment.
220+
221+
To enable these components in your Jupyter Notebook environment:
220222
221223
1. Open an Anaconda prompt and activate your environment.
222224
@@ -249,15 +251,15 @@ The procedure in the [Local computer](#local) section installs necessary compone
249251
import sys
250252
sys.path
251253
```
252-
254+
253255
1. To configure the Jupyter Notebook to use your Azure Machine Learning workspace, go to the [Create a workspace configuration file](#workspace) section.
254256
255257
256258
### <a id="vscode"></a>Visual Studio Code
257259
258-
Visual Studio Code is a very popular cross platform code editor that supports an extensive set of programming languages and tools through extensions available in the [Visual Studio marketplace](https://marketplace.visualstudio.com/vscode). The [Azure Machine Learning extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-ai) installs the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for coding in all types of Python environments (virtual, Anaconda, etc). In addition, it provides convenience features for working with Azure Machine Learning resources and running Azure Machine Learning experiments all without leaving Visual Studio Code.
260+
Visual Studio Code is a very popular cross platform code editor that supports an extensive set of programming languages and tools through extensions available in the [Visual Studio marketplace](https://marketplace.visualstudio.com/vscode). The [Azure Machine Learning extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-ai) installs the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for coding in all types of Python environments (virtual, Anaconda, etc.). In addition, it provides convenience features for working with Azure Machine Learning resources and running Azure Machine Learning experiments all without leaving Visual Studio Code.
259261
260-
To use Visual Studio Code for development, do the following:
262+
To use Visual Studio Code for development:
261263
262264
1. Install the Azure Machine Learning extension for Visual Studio Code, see [Azure Machine Learning](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-ai).
263265
@@ -298,7 +300,7 @@ Use these settings:
298300
| Setting |Applies to| Value |
299301
|----|---|---|
300302
| Cluster name |always| yourclustername |
301-
| Databricks Runtime |always| Any non ML runtime (non ML 4.x, 5.x) |
303+
| Databricks Runtime |always| Any non-ML runtime (non-ML 4.x, 5.x) |
302304
| Python version |always| 3 |
303305
| Workers |always| 2 or higher |
304306
| Worker node VM types <br>(determines max # of concurrent iterations) |Automated ML<br>only| Memory optimized VM preferred |
@@ -322,7 +324,7 @@ Once the cluster is running, [create a library](https://docs.databricks.com/user
322324
* Do not select **Attach automatically to all clusters**.
323325
* Select **Attach** next to your cluster name.
324326
325-
1. Monitor for errors until status changes to **Attached**, which may take several minutes. If this step fails, check the following:
327+
1. Monitor for errors until status changes to **Attached**, which may take several minutes. If this step fails:
326328
327329
Try restarting your cluster by:
328330
1. In the left pane, select **Clusters**.

articles/machine-learning/service/how-to-vscode-tools.md

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The [Azure Machine Learning service](overview-what-is-azure-ml.md) streamlines t
2828
+ [Install Python 3.5 or later](https://www.anaconda.com/download/).
2929

3030

31-
## Install Azure Machine Learning extension for Visual Studio Code
31+
## Install the extension
3232

3333
When you install the Azure Machine Learning extension, two more extensions are automatically installed. They're the [Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) and the [Microsoft Python extension](https://marketplace.visualstudio.com/items?itemName=ms-Python.Python). For more information about using the Python extension for editing, running, and debugging Python code, see the [Python hello-world tutorial](https://code.visualstudio.com/docs/Python/Python-tutorial).
3434

@@ -48,7 +48,8 @@ To install the Azure Machine Learning extension:
4848

4949
The Azure Account extension, which was installed along with the Azure Machine Learning for Visual Studio Code extension, helps you authenticate with your Azure account. For a list of commands, see the page for the [Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account).
5050

51-
> [Tip] You can also download the extension installer directly from [Azure Machine Learning for Visual Studio Code extension (preview)](https://aka.ms/vscodetoolsforai).
51+
> [!TIP]
52+
> You can also download the extension installer directly from [Azure Machine Learning for Visual Studio Code extension (preview)](https://aka.ms/vscodetoolsforai).
5253
5354
## Quickstart with Azure Machine Learning
5455
There are multiple ways of running your training scripts using the Azure Machine Learning service. If you're just getting started, let's first walk through how to quickly submit a training script to run in Azure.
@@ -68,11 +69,11 @@ Let's get started. You can use your own training script if you have it ready, or
6869

6970
1. Open **train.py** and run it by opening the debugger and pressing the run button (or just press F5).
7071

71-
[![Run MNIST Training](./media/vscode-tools-for-ai/RunMNIST.gif)](./media/vscode-tools-for-ai/RunMNIST.gif#lightbox)
72+
[![Run MNIST Training](./media/vscode-tools-for-ai/run-mnist.gif)](./media/vscode-tools-for-ai/run-mnist.gif#lightbox)
7273

7374
If everything is installed correctly, the script will run and create a TensorFlow model in the outputs folder.
7475

75-
[![Show TensorFlow Model](./media/vscode-tools-for-ai/ShowTensorFlowModel.gif)](./media/vscode-tools-for-ai/ShowTensorFlowModel.gif#lightbox)
76+
[![Show TensorFlow Model](./media/vscode-tools-for-ai/show-tensorflow-model.gif)](./media/vscode-tools-for-ai/show-tensorflow-model.gif#lightbox)
7677

7778
Now that you know that your script runs correctly, let's run it in Azure!
7879

@@ -83,56 +84,56 @@ To modify your project so that Azure can be made aware of important information
8384

8485
1. Create a file called **amlrun.py** in the same folder as **train.py**
8586

86-
```Python
87-
import azureml
88-
from azureml.core import Run
89-
90-
# access the Azure ML run
91-
# init run param to check if running within AML
92-
def get_AMLRun():
93-
try:
94-
run = Run.get_submitted_run()
95-
return run
96-
except Exception as e:
97-
print("Caught = {}".format(e.message))
98-
return None
99-
```
87+
```Python
88+
import azureml
89+
from azureml.core import Run
90+
91+
# access the Azure ML run
92+
# init run param to check if running within AML
93+
def get_AMLRun():
94+
try:
95+
run = Run.get_submitted_run()
96+
return run
97+
except Exception as e:
98+
print("Caught = {}".format(e.message))
99+
return None
100+
```
100101

101102
2. Import the amlrun file in **train.py**
102103

103-
```Python
104-
...
105-
from utils import prepare_data
106-
from amlrun import get_AMLRun
107-
...
108-
```
104+
```Python
105+
...
106+
from utils import prepare_data
107+
from amlrun import get_AMLRun
108+
...
109+
```
109110
3. Initialize the run object in **train.py**
110111

111-
```Python
112-
...
113-
init = tf.global_variables_initializer()
114-
saver = tf.train.Saver()
115-
run = get_AMLRun()
116-
...
117-
```
112+
```Python
113+
...
114+
init = tf.global_variables_initializer()
115+
saver = tf.train.Saver()
116+
run = get_AMLRun()
117+
...
118+
```
118119
4. Log metrics to Azure with the run.log() function:
119120

120-
```Python
121-
...
122-
acc_val = acc_op.eval(feed_dict = {X: X_test, y: y_test})
121+
```Python
122+
...
123+
acc_val = acc_op.eval(feed_dict = {X: X_test, y: y_test})
123124

124-
# log accuracies to AML logger if using AML
125-
if run != None:
126-
run.log('Validation Accuracy', np.float(acc_val))
127-
run.log('Training Accuracy', np.float(acc_train))
125+
# log accuracies to AML logger if using AML
126+
if run != None:
127+
run.log('Validation Accuracy', np.float(acc_val))
128+
run.log('Training Accuracy', np.float(acc_train))
128129

129-
print(epoch, '-- Training accuracy:', acc_train, '\b Validation
130-
...
131-
```
130+
print(epoch, '-- Training accuracy:', acc_train, '\b Validation
131+
...
132+
```
132133
### Run the script in Azure
133134
That's it! Now just use the extension to run your script in the cloud! Note that the following walkthrough video takes the liberty of compressing the amount of time it takes to create a new Azure ML workspace and compute, as well as the time it takes to run the training script.
134135

135-
[![Start an Azure ML experiment](./media/vscode-tools-for-ai/StartGoldenPath.gif)](./media/vscode-tools-for-ai/StartGoldenPath.gif#lightbox)
136+
[![Start an Azure ML experiment](./media/vscode-tools-for-ai/start-golden-path.gif)](./media/vscode-tools-for-ai/start-golden-path.gif#lightbox)
136137

137138
After clicking the Run Experiment button, answer the prompts as follows:
138139

@@ -146,12 +147,12 @@ After clicking the Run Experiment button, answer the prompts as follows:
146147
1. Review the default names and specs for the experiment run and click the **Submit Experiment** link in the json file. The json file won't be saved as it's simply there for you to review or change the experiment settings before submission.
147148
1. Sit back and relax while the extension sets everything up for you and runs your script!
148149

149-
[![Train in cloud](./media/vscode-tools-for-ai/RunGoldenPath.gif)](./media/vscode-tools-for-ai/RunGoldenPath.gif#lightbox)
150+
[![Train in cloud](./media/vscode-tools-for-ai/run-golden-path.gif)](./media/vscode-tools-for-ai/run-golden-path.gif#lightbox)
150151

151152
In a few seconds, you'll be notified that the experiment has been submitted to Azure at which time you can view its progress either in the Azure portal by clicking the **View Experiment Run** link in the VS Code notification, or inside VS Code by hitting the refresh button in the Azure tab.
152153

153154
At the moment, viewing run metrics is only supported in the Azure portal. The **View Experiment Run** link mentioned above will take you to the run where you'll see the metrics you logged.
154-
[![Experiment run in portal](./media/vscode-tools-for-ai/ExperimentRunOnPortal.PNG)](./media/vscode-tools-for-ai/ExperimentRunOnPortal.PNG#lightbox)
155+
[![Experiment run in portal](./media/vscode-tools-for-ai/experiment-run-on-portal.PNG)](./media/vscode-tools-for-ai/experiment-run-on-portal.PNG#lightbox)
155156

156157
## Azure Machine Learning in-depth with VS Code
157158

@@ -163,7 +164,7 @@ Before you start training and deploying machine learning models in Visual Studio
163164

164165
1. On the Visual Studio Code activity bar, select the Azure icon. The Azure Machine Learning sidebar appears.
165166

166-
[![Create a workspace](./media/vscode-tools-for-ai/CreateaWorkspace.gif)](./media/vscode-tools-for-ai/CreateaWorkspace.gif#lightbox)
167+
[![Create a workspace](./media/vscode-tools-for-ai/create-workspace.gif)](./media/vscode-tools-for-ai/create-workspace.gif#lightbox)
167168

168169

169170
1. Right-click your Azure subscription and select **Create Workspace**. By default a name is generated containing the date and time of creation. Change the name to **TeamWorkspace** and press enter.
@@ -185,7 +186,7 @@ One or more experiments can be created in your workspace to track and analyze in
185186

186187
1. In a workspace, you can right-click an experiment to set it as the **Active** experiment. The **Active** experiment links that experiment in the cloud to the folder you currently have open in Visual Studio Code. This folder should contain your local Python scripts. By setting an active experiment, key metrics for all training runs will be stored within the experiment, regardless of where they're executed.
187188

188-
[![Attach a folder in Visual Studio Code](./media/vscode-tools-for-ai/CreateAnExperiment.gif)](./media/vscode-tools-for-ai/CreateAnExperiment.gif#lightbox)
189+
[![Create an Experiment](./media/vscode-tools-for-ai/create-experiment.gif)](./media/vscode-tools-for-ai/create-experiment.gif#lightbox)
189190

190191

191192
### Create and manage compute targets
@@ -216,15 +217,15 @@ To create a compute target:
216217

217218
Here's an example of how to create and edit an Azure Machine Learning compute (AMLCompute):
218219

219-
[![Create AML compute in Visual Studio Code](./media/vscode-tools-for-ai/CreateARemoteCompute.gif)](./media/vscode-tools-for-ai/CreateARemoteCompute.gif#lightbox)
220+
[![Create AML compute in Visual Studio Code](./media/vscode-tools-for-ai/create-remote-compute.gif)](./media/vscode-tools-for-ai/create-remote-compute.gif#lightbox)
220221

221222
#### The run configuration file
222223

223224
To run an Azure Machine Learning experiment on a compute, that compute needs to be configured appropriately. A run configuration file is the mechanism by which this environment is specified.
224225

225226
Here's an example of how to create a run configuration for the AmlCompute, created above.
226227

227-
[![Create a run configuration for a compute](./media/vscode-tools-for-ai/CreateARunConfig.gif)](./media/vscode-tools-for-ai/CreateARunConfig.gif#lightbox)
228+
[![Create a run configuration for a compute](./media/vscode-tools-for-ai/create-runconfig.gif)](./media/vscode-tools-for-ai/create-runconfig.gif#lightbox)
228229

229230
To run Azure ML experiments on your local machine a run configuration file is still required. When creating a local run configuration the Python environment used will default to the path to the interpreter you have set within VS Code.
230231

@@ -253,12 +254,12 @@ To run an Azure Machine Learning experiment:
253254

254255
Here's an example of how to run an experiment on the compute previously created:
255256

256-
[![Run an experiment locally](./media/vscode-tools-for-ai/RunExperiment.gif)](./media/vscode-tools-for-ai/RunExperiment.gif#lightbox)
257+
[![Run an experiment locally](./media/vscode-tools-for-ai/run-experiment.gif)](./media/vscode-tools-for-ai/run-experiment.gif#lightbox)
257258

258259
### Deploy and manage models
259260
In Azure Machine Learning, you can deploy and manage your machine learning models in the cloud and at the edge.
260261

261-
### 1. Register your model to Azure Machine Learning from Visual Studio Code
262+
#### Register your model to Azure Machine Learning from Visual Studio Code
262263

263264
Now that you've trained your model, you can register it in your workspace. You can track and deploy registered models.
264265

@@ -280,10 +281,10 @@ To register your model:
280281

281282
Here's an example of how to register your model to Azure Machine Learning:
282283

283-
[![Registering a Model to AML](./media/vscode-tools-for-ai/RegisteringAModel.gif)](./media/vscode-tools-for-ai/RegisteringAModel.gif#lightbox)
284+
[![Registering a Model to AML](./media/vscode-tools-for-ai/register-model.gif)](./media/vscode-tools-for-ai/register-model.gif#lightbox)
284285

285286

286-
### 2. Deploy your service from Visual Studio Code
287+
#### Deploy your service from Visual Studio Code
287288

288289
In Visual Studio Code, you can deploy your web service to:
289290
+ Azure Container Instances (ACI) for testing.
@@ -315,11 +316,11 @@ The web service is now deployed.
315316

316317
Here's an example of how to deploy a web service:
317318

318-
[![Deploy a web service](./media/vscode-tools-for-ai/CreatingAnImage.gif)](./media/vscode-tools-for-ai/CreatingAnImage.gif#lightbox)
319+
[![Deploy a web service](./media/vscode-tools-for-ai/create-image.gif)](./media/vscode-tools-for-ai/create-image.gif#lightbox)
319320

320-
### Use keyboard shortcuts
321+
### Experiment with additional features
321322

322-
You can use the keyboard to access Azure Machine Learning features in Visual Studio Code. The most important keyboard shortcut to know is Ctrl+Shift+P, which displays the command palette. From the command palette, you have access to all of the functionality of Visual Studio Code, including keyboard shortcuts for the most common operations.
323+
You can use the Command Palette to access many Azure Machine Learning features in Visual Studio Code. To invoke the Command Palette type Ctrl+Shift+P. From here, you can search for additional Azure ML features of the extension.
323324

324325
[![Keyboard shortcuts for Azure Machine Learning for Visual Studio Code](./media/vscode-tools-for-ai/commands.gif)](./media/vscode-tools-for-ai/commands.gif#lightbox)
325326

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)