John Pace
  • Home
  • About
  • Contact

​​
​
Data Scientist, husband, father of 3 great daughters, 5x Ironman triathlon finisher, just a normal guy who spent a lot of time in school.
Let’s explore data science, artificial intelligence, machine learning, and other topics together.

Keras Tensorboard callback - see what's happening as it's happening

9/11/2020

0 Comments

 
Picturehttps://keras.io/

This post is part 3 of my 4 part series on Keras Callbacks.  A callback is an object that can perform actions at various stages of training and is specified when the model is trained using model.fit(). In today's post, I give a very brief overview of the Tensorboard callback.

Picture
Graphs showing training and validation accuracy and loss. Image from https://github.com/shekkizh/FCN.tensorflow/issues/50
Picture

If you are reading this post, then chances are that you have heard of Tensorboard.  It is a great visualization tool that works with Tensorflow to allow you to visualize what is going on in the background while your job is running.  You can see nice graphs of loss and accuracy, as well as visualizations of your neural network. It has other features as well, but I'll only mention these for now.  Take a few minutes to explore it.  It is worth the time!  
​

Picture
Visualization of neural network

While there are multiple arguments that the Tensorboard callback can take, the one I want to discuss today is the log_dir.  log_dir allows you to specify the directory where the Tensorboard log files are saved.  The files in this directory are read by Tensorboard to create the visualizations.  This comes in very handy when you are train with different models or with different hyperparameters.  Simply specify different directories and you are all set.  If the directory does not exist, it will be created when the callback is used.

Here is a short snippet of code that creates and uses the callback.  Since this particular job is doing linear regression with 100,000 datapoints, I add that to the directory name.  The newly created directory looks something like this.

logs/linear_regression_100k_datapoints-20200911-130022/
​

    

Now we have the Tensorboard log files being written to a very specific directory that clearly tracks the specific training job.  This is a great way to keep up with what you have done!

​If you have questions and want to connect, you can message me on LinkedIn or Twitter. Also, follow me on Twitter @pacejohn and LinkedIn https://www.linkedin.com/in/john-pace-phd-20b87070/.

#artificialintelligence #ai #machinelearning #ml #tensorflow #keras #neuralnetworks #deeplearning #tensorboard #hyperparameters #callbacks #visualization
0 Comments



Leave a Reply.

    Archives

    December 2020
    November 2020
    September 2020
    August 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    May 2019
    April 2019
    March 2019
    April 2018
    March 2018
    January 2018
    November 2017

    Tweets by pacejohn
Proudly powered by Weebly
  • Home
  • About
  • Contact