Visualizing your model using TensorBoard

Visualizing your model using TensorBoard

Debugging problems are much easier when you can see what the problem is. But in a complex model with pieces of fidget data ted, that can get ... complex. Thanks, Tensorboard makes it a lot easier.

Unlike traditional programming, machine learning is often very unpredictable. The quality of your data, including the nuances of our model, will have many parameters to choose from, all of which have detailed implications for the success or failure of the training process.

If only there was some way to track some of these metrics through the training process, and also look at the structure of the model we created, which enables us to tune and debug the model.

Now, this abstract process may be hard to imagine, but fortunately, TensorFlow has a built-in solution!
Visit Tensorboard, TensorFlow's built-in visualizer, which enables you to perform detailed tasks to see training progress from looking at your model structure.

Tensorflow uses the idea of ​​computational graphs under the hood.

This means that instead of adding two numbers in the traditional sense, it operates one operator and passes the combined value as input.

So when we think of TensorFlow training your model, it's really implementing everything as part of its "graph". The TensorBoard can visualize these model graphs so you can see what they look like, and more importantly, make sure you've cut all the pieces you want.

Here is an example of a more complex version of the model graph shown by TensorFlow. The tensorboard gives us detailed information on the elements to zoom, pan, and expand. This means we can look at models at different levels of abstraction, which helps reduce visual complexity.

In any case, it is not enough for the tensorboard to show the model structure. It can also plot the progress of metrics in a good graph. Generally, we will make things like accuracy, deficit, cross-entropy, and more. Depending on the model, different metrics may be important. Cans estimators of TensorFlow come with a number of pre-configured values ​​to display on the tensorboard, which serves as an excellent starting point.

Tensorboard can display a wide variety of other information, including histograms, distributions, embeddings, as well as audio, image, and text data. But that's for future videos.

Let us look at an example of a tensorboard with the linear model we have used so far. First, we will start the tensorboard and point it to the directory where our model structure and checkpoint files are protected by running:

tensorboard --logdir = "/ tmp / iris_model /"

It starts a local server on port 6006. And yes, that goes to GOOG :) Go to localhost: 60000 to see the tensorboard on your local machine.

We can see some scalar metrics provided by default with a linear classifier. We can expand and zoom in any of these graphs.

Double click allows us to zoom out. As you can see, our training has grown exponentially, with declining losses. It is also clear that the training is not fully completed, the deficit is still declining at a good rate, so it may allow us to run the training mode longer, to take more advantage of this model.

Now let's go to the Graph tab. Note that the graph on the surface is quite simple.

We are able to expand each of these blocks by clicking plus sign to see more details. For example, if I extend the "Linear" block, we see that it is made up of a number of sub comp components. We can scroll to zoom in and out and click and drag on the pan.

Also note that the names we have given to our feature columns, "floor_features", will appear as the named graph component.

This helps in debugging and identifying how the graph is hooked up. Most of the TensorFlow operations can be named, so this may be the best way to clarify your model.

Today we have learned that machine learning is very easy and fun when you can visualize the model with important training metrics. The tensorboard allows you to do this easily, and it's built into the TensorFlow!

Next time you need to visualize your machine learning, use the tensorboard to see what's going on under the hood!