Skip to Main Content
Python Deep Learning Projects
book

Python Deep Learning Projects

by Matthew Lamons, Rahul Kumar, Abhishek Nagaraja
October 2018
Intermediate to advanced content levelIntermediate to advanced
472 pages
10h 57m
English
Packt Publishing
Content preview from Python Deep Learning Projects

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Python Deep Learning for the Web

Hands-On Python Deep Learning for the Web

Anubhav Singh, Sayak Paul

Publisher Resources

ISBN: 9781788997096Supplemental Content