Reader small image

You're reading from  Hands-On Machine Learning on Google Cloud Platform

Product typeBook
Published inApr 2018
PublisherPackt
ISBN-139781788393485
Edition1st Edition
Right arrow
Authors (3):
Giuseppe Ciaburro
Giuseppe Ciaburro
author image
Giuseppe Ciaburro

Giuseppe Ciaburro holds a PhD and two master's degrees. He works at the Built Environment Control Laboratory - Università degli Studi della Campania "Luigi Vanvitelli". He has over 25 years of work experience in programming, first in the field of combustion and then in acoustics and noise control. His core programming knowledge is in MATLAB, Python and R. As an expert in AI applications to acoustics and noise control problems, Giuseppe has wide experience in researching and teaching. He has several publications to his credit: monographs, scientific journals, and thematic conferences. He was recently included in the world's top 2% scientists list by Stanford University (2022).
Read more about Giuseppe Ciaburro

V Kishore Ayyadevara
V Kishore Ayyadevara
author image
V Kishore Ayyadevara

V Kishore Ayyadevara leads a team focused on using AI to solve problems in the healthcare space. He has 10 years' experience in data science, solving problems to improve customer experience in leading technology companies. In his current role, he is responsible for developing a variety of cutting edge analytical solutions that have an impact at scale while building strong technical teams. Prior to this, Kishore authored three books — Pro Machine Learning Algorithms, Hands-on Machine Learning with Google Cloud Platform, and SciPy Recipes. Kishore is an active learner with keen interest in identifying problems that can be solved using data, simplifying the complexity and in transferring techniques across domains to achieve quantifiable results.
Read more about V Kishore Ayyadevara

Alexis Perrier
Alexis Perrier
author image
Alexis Perrier

Alexis Perrier is a data science consultant with experience in signal processing and stochastic algorithms. He holds a master's in mathematics from Universit Pierre et Marie Curie Paris VI and a PhD in signal processing from Tlcom ParisTech. He is actively involved in the DC data science community. He is also an avid book lover and proud owner of a real chalk blackboard, where he regularly shares his fascination of mathematical equations with his kids.
Read more about Alexis Perrier

View More author details
Right arrow

Evaluating Results with TensorBoard

In the previous chapter, we understood how a neural network works, what the various hyper parameters in a neural network are, and how they can be tweaked further to improve our model's accuracy.

Google offers TensorBoard, a visualization of the model training logs. In this chapter, we show how to use TensorBoard for TensorFlow and Keras. We interpret the visualizations generated by TensorBoard to understand the performance of our models, and also understand the other functionalities in TensorBoard that can help visualize our dataset better.

As discussed in the previous chapter, Keras as a framework is a wrapper on top of either TensorFlow or Theano. The computations that you'll use TensorFlow for, such as training a massive deep neural network, can be complex and confusing. To make it easier to understand, debug, and optimize TensorFlow...

Setting up TensorBoard

In the previous chapter, we understood how Datalab can be set up. Installing TensorBoard in Datalab is as simple as specifying the following code:

Note that we need not make any separate installations for TensorBoard and it comes in prebuilt within the google.datalab.ml package.

Once the package is imported, we need to start TensorBoard by specifying the location of logs that contain the summaries written by the model fitting process.

The tb.start method works as follows:

Note that, in the first step, it checks whether the user is permitted to perform the calculation. Next, it picks up an unused port to open TensorBoard, and finally it starts TensorBoard along with printing the link to open TensorBoard.

We will learn more about writing to logs in the next section.

Overview of summary operations

Summaries provide a way to export condensed information about a model, which is then accessible in tools such as TensorBoard.

Some of the commonly used summary functions are:

  • scalar
  • histogram
  • audio
  • image
  • merge
  • merge_all

A scalar summary operation returns a scalar, that is, the value of a certain metric over an increasing number of epochs.

A histogram summary operation returns the histogram of various values—potentially weights and biases at each layer.

The image and audio summary operations return images and audio, which can be visualized and played in TensorBoard respectively.

A merge operation returns the union of all the values of input summaries, while merge_all returns the union of all the summaries contained in the model specification.

A visualization of some of the summaries discussed here will be provided in the next section.

...

Summary

In this chapter, we understood visualizing neural network models in TensorBoard, both from Keras and TensorFlow. We also considered how to visualize the models, distribution of weights, and loss/accuracy metrics in both premade estimators and custom defined estimators. And also the various metrics in neural networks.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Machine Learning on Google Cloud Platform
Published in: Apr 2018Publisher: PacktISBN-13: 9781788393485
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Giuseppe Ciaburro

Giuseppe Ciaburro holds a PhD and two master's degrees. He works at the Built Environment Control Laboratory - Università degli Studi della Campania "Luigi Vanvitelli". He has over 25 years of work experience in programming, first in the field of combustion and then in acoustics and noise control. His core programming knowledge is in MATLAB, Python and R. As an expert in AI applications to acoustics and noise control problems, Giuseppe has wide experience in researching and teaching. He has several publications to his credit: monographs, scientific journals, and thematic conferences. He was recently included in the world's top 2% scientists list by Stanford University (2022).
Read more about Giuseppe Ciaburro

author image
V Kishore Ayyadevara

V Kishore Ayyadevara leads a team focused on using AI to solve problems in the healthcare space. He has 10 years' experience in data science, solving problems to improve customer experience in leading technology companies. In his current role, he is responsible for developing a variety of cutting edge analytical solutions that have an impact at scale while building strong technical teams. Prior to this, Kishore authored three books — Pro Machine Learning Algorithms, Hands-on Machine Learning with Google Cloud Platform, and SciPy Recipes. Kishore is an active learner with keen interest in identifying problems that can be solved using data, simplifying the complexity and in transferring techniques across domains to achieve quantifiable results.
Read more about V Kishore Ayyadevara

author image
Alexis Perrier

Alexis Perrier is a data science consultant with experience in signal processing and stochastic algorithms. He holds a master's in mathematics from Universit Pierre et Marie Curie Paris VI and a PhD in signal processing from Tlcom ParisTech. He is actively involved in the DC data science community. He is also an avid book lover and proud owner of a real chalk blackboard, where he regularly shares his fascination of mathematical equations with his kids.
Read more about Alexis Perrier