I've started us off in this chapter by copying our networks and data from Chapter 2, Using Deep Learning to Solve Regression Problems. We're going to make a few simple additions to add our TensorBoard callback. Let's start by modifying the mlp we built first.
First, we need to import the TensorBoard callback class, using the following code:
from keras.callbacks import TensorBoard
Then we will initiate the callback. I like to do this inside a function that creates all my callbacks, to keep things carefully crafted and tidy. The create_callbacks() function below will return a list of all the callbacks we will pass to .fit(). In this case, it returns a list with one element:
def create_callbacks(): tensorboard_callback ...