Hands-On Deep Learning for Games
上QQ阅读APP看书,第一时间看更新

Monitoring training with TensorBoard

TensorBoard is essentially a mathematical graph or calculation engine that performs very well at crunching numbers, hence our use of it in deep learning. The tool itself is still quite immature, but there are some very useful features for monitoring training exercises.

Follow these steps to start monitoring training on our sample:

  1. You can monitor the training session by entering the following command into a new Anaconda or command window from the same directory/folder that you are running the sample from:
//first change directory to sample working folder
tensorboard --logdir=/tmp/autoencoder
  1. This will launch a TensorBoard server, and you can view the output by navigating your browser to the URL in italics, as shown in the window you are running TensorBoard from. It will typically look something like the following:
TensorBoard 1.10.0 at http://DESKTOP-V2J9HRG:6006 (Press CTRL+C to quit)
or use
http://0.0.0.0:6000
  1. Note, the URL should use your machine name, but if that doesn't work, try the second form. Be sure to allow ports 6000, and 6006 and/or the TensorBoard application through your firewall if prompted.
  2. When the sample is done running, you should see the following:


Auto-encoding digits using convolution
  1. Go back and compare the results from this example and the last example from Chapter 1, Deep Learning for Games. Note the improvement in performance.

Your immediate thought may be, "Is the increased training time we experienced worth the effort?" After all, the decoded images look quite similar in the previous example, and it trained much faster, except, remember we are training the network weights slowly by adjusting each weight over each iteration, which we can then save as a model. That model or brain can then be used to perform the same task again later, without training. Works scarily enough! Keep this concept in mind as we work through this chapter. In Chapter 3, GAN for Games, we will start saving and moving our brain models around.

In the next section, we take a more in-depth look at how convolution works. Convolution can be tricky to understand when you first encounter it, so take your time. It is important to understand how it works, as we will use it extensively later.