Visual Studio Code Tools for AI Extension



image

Visual Studio Code Tools for AI is an extension to build, test, and deploy Deep Learning / AI solutions in Microsoft Visual Studio Code. This allows you to develop deep learning and AI solutions across Windows and MacOS

This extension seamlessly integrates with Azure Machine Learning for robust experimentation capabilities, including but not limited to submitting data preparation and model training jobs transparently to different compute targets. Additionally, it provides support for custom metrics and run history tracking, enabling data science reproducibility and auditing. Enterprise ready collaboration, allow to securely work on project with other people.

VS Code Tools for AI is a cross-platform extension that supports deep learning frameworks including Microsoft Cognitive Toolkit (CNTK), Google TensorFlow and more.

Because it's an IDE we've enabled familiar code editor features like syntax highlighting, IntelliSense (auto-completion) and text auto formatting. You can interactively test your deep learning application in your local environment using step-through debugging on local variables and models.

deep learning ide

This extension makes it easy to train models on your local computer or you can submit jobs to the cloud by using our integration with Azure Machine Learning. You can submit jobs to different compute targets like Spark clusters, Azure GPU virtual machines and more

Installing the Extension

  • First, install Visual Studio Code then install Tools for AI extension by pressing F1 or ctrl+shift+p to open command palette, select Install Extension and type tools for AI.

Commands

The extension provides several commands in the Command Palette for working with deep learning and machine learning:

  • AI: List Jobs: View list of recent jobs you've submitted and their details
  • AI: Open Azure ML Sample Explorer: Quickly get started with machine learning and deep learning experimentation by downloading sample projects you can run and modify to meet your needs
  • AI: Azure ML - Set Subscription: Set your Azure Subscription to use for Azure Machine Learning experimentation
  • AI: Azure ML - Open Terminal: Open Azure CLI terminal to access full Azure feature set
  • AI: Add Platform Configuration: Configure Azure Machine learning compute target

Try this extension using the available sample project

To open the explorer, do as follow:

  1. Open the command palette (View > Command Palette or Ctrl+Shift+P).

  2. Enter "ML Sample".
  3. You get a recommendation for "Machine Learning: Open Azure Machine Learning Samples Explorer", select it and press enter.

sample explorer

Creating a new project from the sample explorer

You can browse different samples and get more information about them. Let's browse until finding the "Classifying Iris" sample.

To create a new project based on this sample do the following:

  1. Click install button on the project sample, notice the commands being prompted, walking you through the steps of creating a new project.

  2. Enter a name for the project, for example "Iris".
  3. Enter a folder to create your project and press enter.
  4. Select an existing workspace and press enter.

The project will then be created.

You will need to be logged-in to access your Azure resource. From the embedded terminal enter "az login" and follow the instruction.

Submitting a job to train your model locally or in the cloud

Now that the new project is open in Visual Studio Code, you can submit a model training job to your different compute targets (local or VM with docker  such as the https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoft-ads.linux-data-science-vm-ubuntu).

Visual Studio Code Tools for AI provides multiple ways to submit a model training job.

  1. Context Menu (right click) - Machine Learning: Submit Job.

  2. From the command palette: "Machine Learning: Submit Job".
  3. Alternatively, you can run the command directly using Azure CLI, Machine Learning Commands, using the embedded terminal.

submit job

Open iris_sklearn.py, right click and select Machine Learning: Submit Job.

  1. Select your platform: "Azure Machine Learning".

  2. Select your run-configuration: "Docker-Python."

If it is the first time your submit a job, you receive a message "No Machine Learning configuration found, creating...". A JSON file is opened, save it (Ctrl+S).

Once the job is submitted, the embedded-terminal displays the progress of the runs.

View recent job performance and details

Once the jobs are submitted, you can list the jobs from the run history.

  1. Open the command palette (View > Command Palette or Ctrl+Shift+P).

  2. Enter "AI List."
  3. You get a recommendation for "AI: List Jobs", select and press enter.
  4. Select the platform "Azure Machine Learning."

The Job List View opens and displays all the runs and some related information.

add data source

To view the results of a job, click on the job ID link to see detailed information.

Additional Resource

See the key announcements from Ignite 2017 https://myignite.microsoft.com

Joseph Sirosh, Corporate Vice President of the Cloud AI Platform, as he dives deep into the latest additions to the Microsoft AI platform and capabilities. Innovations in AI let any developer and data scientist infuse intelligence into their applications and target entirely new scenarios. https://myignite.microsoft.com/videos/56555

Comments (2)

Skip to main content