Skip to main content

Keras with Matplotlib - Jupyter Notebook

The jupyter.ipynb example demonstrates ClearML's automatic logging of code running in a Jupyter Notebook that uses Keras and Matplotlib.

The example does the following:

  1. Trains a simple deep neural network on the Keras built-in MNIST dataset.
  2. Builds a sequential model using a categorical cross entropy loss objective function.
  3. Specifies accuracy as the metric, and uses two callbacks: a TensorBoard callback and a model checkpoint callback.
  4. During script execution, creates an experiment named notebook example in the examples project.

Scalars

The loss and accuracy metric scalar plots appear in SCALARS, along with the resource utilization plots, which are titled :monitor: machine.

image

Plots

The example calls Matplotlib methods to create several sample plots, and TensorBoard methods to plot histograms for layer density. They appear in PLOTS.

image

image

Debug Samples

The example calls Matplotlib methods to log debug sample images. They appear in DEBUG SAMPLES.

image

Hyperparameters

ClearML automatically logs TensorFlow Definitions. A parameter dictionary is logged by connecting it to the Task, by calling Task.connect().

task_params = {'num_scatter_samples': 60, 'sin_max_value': 20, 'sin_steps': 30}
task_params = task.connect(task_params)

Later in the Jupyter Notebook, more parameters are added to the dictionary.

task_params['batch_size'] = 128
task_params['nb_classes'] = 10
task_params['nb_epoch'] = 6
task_params['hidden_dim'] = 512

Parameter dictionaries appear in CONFIGURATION > HYPERPARAMETERS > General.

image

The TensorFlow Definitions appear in the TF_DEFINE subsection.

image

Console

Text printed to the console for training appears in CONSOLE.

image

Artifacts

Models created by the experiment appear in the experiment's ARTIFACTS tab. ClearML automatically logs and tracks models created using Keras.

The experiment info panel shows model tracking, including the model name and design in ARTIFACTS > Output Model.

image

Clicking on the model name takes you to the model's page, where you can view the model's details and access the model.

image