In this section, we'll look at how to convert our TensorFlow code to run on TFoS. To do this, first, we need to build an EC2 cluster on Amazon AWS. One of the easy ways to do this is to use Flintrock, a CLI tool for launching Apache Spark clusters from your local machine.
The following are the prerequisites that you'll need to complete this section:
- Hadoop
- PySpark
- Flintrock
- Python
- TensorFlow
- TensorFlowOnSpark
Now, let's see how we can do this. We're using the MNIST dataset (http://yann.lecun.com/exdb/mnist/). The following code is taken from the TensorFlowOnSpark GitHub. The repository contains the links to documentation and more examples (https://github.com/yahoo/TensorFlowOnSpark):
- Define the model architecture ...