Building the training loop

The next step is to utilize the model for training, and record the learned model parameters, which we will accomplish in train.py.

Let's start by importing the dependencies:

import tensorflow as tfimport hy_param# MLP Model which we defined in previous stepimport model

Then, we define the variables that we require to be fed into our MLP:

# This will feed the raw imagesX = model.X# This will feed the labels associated with the imageY = model.Y

Let's create the folder to which we will save our checkpoints. Checkpoints are basically the intermediate steps that capture the values of W and b in the process of learning. Then, we will use the tf.train.Saver() function (more details on this function can be found at https://www.tensorflow.org/api_docs/python/tf/train/Saver ...

Get Python Deep Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.