From the course: Building and Deploying Deep Learning Applications with TensorFlow

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up the model training loop

Set up the model training loop - TensorFlow Tutorial

From the course: Building and Deploying Deep Learning Applications with TensorFlow

Start my 1-month free trial

Set up the model training loop

- [Instructor] Let's open up training_loop.py from the exercise files. Once you have loaded your data set and defined your model, you're ready to create a training loop to train the model. Here, we've already defined the variable called training_epochs on line 38. An epoch is another name for one full training pass over the training data set. This means we will do 100 iterations in our training loop to train our neural network. Okay, let's get started building the training loop itself. Let's jump down to line 91. To run any operation on the TensorFlow graph, you first need to create a session. We can create a new session by calling tf.Session. Within a session, we can ask TensorFlow to execute commands by calling session.run. Session.run, and then we can pass in the command we want TensorFlow to execute. Those can either be global commands that TensorFlow provides or specific nodes in our graph that we want to execute. The first command we always run is the built in command to tell…

Contents