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

Unlock the full course today

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

Train

Train

- [Instructor] Now that we've set up the the training loop, it's time to get to the actual training. Let's open up training.py. Here we have a neural network with a computational graph and the basic training loop already defined. Let's run the code and see how it works. Right-click. Choose Run. Great, the training seems to have completed successfully. But right now, we don't have a way to see if the accuracy is improving over time during training. Let's add some code to display how the training is progressing. Every five training steps, let's print out the current accuracy. First, let's click to minimize the console window. Now, here on line 104, let's add this line of code. If epoch mod, that's the percent sign, five, equal equal zero: this simply says that for every five passes in the training loop, we want to do something. To get the current accuracy, we can run the neural network's cost function and print out the result. So we'll call session.run and ask it to call the cost…

Contents