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-tensorflow.md
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.date: 12/04/2018
13
13
ms.custom: seodec18
14
14
---
15
15
16
-
# Train TensorFlow models with Azure Machine Learning service
16
+
# Train TensorFlow and Keras models with Azure Machine Learning service
17
17
18
18
For deep neural network (DNN) training using TensorFlow, Azure Machine Learning provides a custom `TensorFlow` class of the `Estimator`. The Azure SDK's `TensorFlow` estimator (not to be conflated with the [`tf.estimator.Estimator`](https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator) class) enables you to easily submit TensorFlow training jobs for both single-node and distributed runs on Azure compute.
conda_packages=['scikit-learn'],# in case you need scikit-learn in train.py
38
38
use_gpu=True)
39
39
```
40
40
@@ -56,6 +56,21 @@ Then, submit the TensorFlow job:
56
56
run = exp.submit(tf_est)
57
57
```
58
58
59
+
## Keras support
60
+
[Keras](https://keras.io/) is a popular high-level DNN Python API that supports TensorFlow, CNTK or Theano as backends. If you use TensorFlow as backend, you can easily use the TensFlow estimator to train a Keras model. Here is an example of a TensorFlow estimator with Keras added to it:
conda_packages=['keras'], # just add keras through conda
70
+
use_gpu=True)
71
+
```
72
+
The above TensorFlow estimator constructor simply instructs Azure Machine Learning service to install Keras through Conda to the execution environment. And your `keras_train.py` can then import Keras API to train a Keras model. For a complete example, please see [this Jupyter notebook](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).
73
+
59
74
## Distributed training
60
75
The TensorFlow Estimator also enables you to train your models at scale across CPU and GPU clusters of Azure VMs. You can easily run distributed TensorFlow training with a few API calls, while Azure Machine Learning will manage behind the scenes all the infrastructure and orchestration needed to carry out these workloads.
0 commit comments