Analyzing results (during or after training) is much more if we can visualize the metrics. A great tool for this is TensorBoard. Originally developed for TensorFlow, it can also be used with other frameworks such as Keras and PyTorch. TensorBoard gives us the ability to follow loss, metrics, weights, outputs, and more. In the following recipe, we'll show you how to use TensorBoard with Keras and leverage it to visualize training data interactively.
- First, we import all the libraries in Python, as follows:
from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D from keras.optimizers import Adam from keras.callbacks import EarlyStopping, TensorBoard, ModelCheckpoint from keras.utils import to_categorical
- Let's load the
cifar10
dataset for this example...