You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/service/how-to-train-keras.md
+8-12Lines changed: 8 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,20 @@ ms.custom: seodec18
14
14
15
15
# Train and register TensorFlow models at scale with Azure Machine Learning service
16
16
17
-
This article shows you how to train and register a Keras model built on TensorFlow using Azure Machine Learning service. It uses the popular [MNIST dataset](http://yann.lecun.com/exdb/mnist/) to classify handwritten digits using a deep neural network built using the [Keras Python library](https://keras.io) running on top of [TensorFlow](https://www.tensorflow.org/overview).
17
+
This article shows you how to train and register a Keras model built on TensorFlow using Azure Machine Learning service. It uses the popular [MNIST dataset](http://yann.lecun.com/exdb/mnist/) to classify handwritten digits using a deep neural network (DNN) built using the [Keras Python library](https://keras.io) running on top of [TensorFlow](https://www.tensorflow.org/overview).
18
18
19
-
Keras is a high-level neural network API capable of running top of other frameworks. Keras is used to simplify the process of building neural networks. With Azure Machine Learning service, you can rapidly scale out open-source training jobs using elastic cloud compute resources. You can also track your training runs, version models, deploy models, and much more.
19
+
Keras is a high-level neural network API capable of running top of other popular DNN frameworks to simplify development. With Azure Machine Learning service, you can rapidly scale out training jobs using elastic cloud compute resources. You can also track your training runs, version models, deploy models, and much more.
20
20
21
21
Whether you're developing a Keras model from the ground-up or you're bringing an existing model into the cloud, Azure Machine Learning service can help you build production-ready models.
22
22
23
23
## Prerequisites
24
24
25
25
- An Azure subscription. Try the [free or paid version of Azure Machine Learning service](https://aka.ms/AMLFree) today.
26
26
-[Install the Azure Machine Learning SDK for Python](setup-create-workspace.md#sdk)
27
+
-[Create a workspace configuration file](setup-create-workspace#write-a-configuration-file)
27
28
-[Download the sample script files](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras)`mnist-keras.py` and `utils.py`
28
29
29
-
You can also find a completed [Jupyter Notebook version](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb) of this guide on GitHub samples page. The notebook includes expanded sections covering intelligent hyperparameter tuning and model deployment.
30
+
You can also find a completed [Jupyter Notebook version](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb) of this guide on GitHub samples page. The notebook includes expanded sections covering intelligent hyperparameter tuning, model deployment, and notebook widgets.
30
31
31
32
## Set up the experiment
32
33
@@ -53,15 +54,10 @@ from azureml.core.compute_target import ComputeTargetException
53
54
54
55
The [Azure Machine Learning service workspace](concept-workspace.md) is the top-level resource for the service. It provides you with a centralized place to work with all the artifacts you create. In the Python SDK, you can access the workspace artifacts by creating a [`workspace`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.workspace.workspace?view=azure-ml-py) object.
55
56
56
-
Create a workspace by finding a value for the <azure-subscription-id> parameter in the [subscriptions list in the Azure portal](https://ms.portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade). Use any subscription in which your role is owner or contributor. For more information on roles, see [Manage access to an Azure Machine Learning workspace](how-to-assign-roles.md) article
57
+
Create a workspace object from the `config.json` file created in the [prerequisites section](#prerequisites).
57
58
58
59
```Python
59
-
ws = Workspace.create(name='myworkspace',
60
-
subscription_id='<azure-subscription-id>',
61
-
resource_group='myresourcegroup',
62
-
create_resource_group=True,
63
-
location='<select-location>'# For example: 'eastus2'
64
-
)
60
+
ws = Workspace.from_config()
65
61
```
66
62
67
63
### Create an experiment
@@ -164,7 +160,7 @@ Once you've trained the model, you can register it to your workspace. Model regi
164
160
model = run.register_model(model_name='keras-dnn-mnist', model_path='outputs/model')
165
161
```
166
162
167
-
You can also download a local copy of the model by using the Run object. In the training script `mnist-keras.py`, a TensorFlow saver object persists the model to a local folder (local to the compute target). You can use the Run object to download a copy.
163
+
You can also download a local copy of the model. This can be useful for doing additional model validation work locally. In the training script,`mnist-keras.py`, a TensorFlow saver object persists the model to a local folder (local to the compute target). You can use the Run object to download a copy from datastore.
168
164
169
165
```Python
170
166
# Create a model folder in the current directory
@@ -179,7 +175,7 @@ for f in run.get_file_names():
179
175
180
176
## Next steps
181
177
182
-
In this article, you trained and registered a TensorFlow model on Azure Machine Learning service. To learn how to deploy a model, continue on to our model deployment article.
178
+
In this article, you trained and registered a Keras model on Azure Machine Learning service. To learn how to deploy a model, continue on to our model deployment article.
183
179
184
180
> [!div class="nextstepaction"]
185
181
> [How and where to deploy models](how-to-deploy-and-where.md)
0 commit comments