2021-05-13 23:48:51 +00:00
|
|
|
---
|
|
|
|
title: Keras with TensorBoard
|
|
|
|
---
|
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|
The example below demonstrates the integration of **ClearML** into code which uses Keras and TensorBoard.
|
|
|
|
View it in [script](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/keras_tensorboard.py)
|
2021-11-07 07:51:34 +00:00
|
|
|
or in [Jupyter Notebook](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/jupyter_keras_TB_example.ipynb).
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|
:::note
|
|
|
|
The example in [Jupyter Notebook](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/jupyter_keras_TB_example.ipynb)
|
|
|
|
includes a clickable icon to open the notebook in Google Colab.
|
|
|
|
:::
|
|
|
|
|
|
|
|
The example script does the following:
|
2021-05-13 23:48:51 +00:00
|
|
|
1. Trains a simple deep neural network on the Keras built-in [MNIST](https://keras.io/api/datasets/mnist/#load_data-function)
|
|
|
|
dataset.
|
2021-11-04 09:21:05 +00:00
|
|
|
1. Builds a sequential model using a categorical cross entropy loss objective function.
|
|
|
|
1. Specifies accuracy as the metric, and uses two callbacks: a TensorBoard callback and a model checkpoint callback.
|
|
|
|
1. During script execution, creates an experiment named `Keras with TensorBoard example`, which is associated with the
|
|
|
|
`examples` project (in script) or the `Colab notebooks` project (in Jupyter Notebook) .
|
|
|
|
|
2021-05-13 23:48:51 +00:00
|
|
|
|
|
|
|
## Scalars
|
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|
The loss and accuracy metric scalar plots appear in **RESULTS** **>** **SCALARS**, along with the resource utilization plots,
|
|
|
|
which are titled **:monitor: machine**.
|
2021-05-13 23:48:51 +00:00
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## Histograms
|
|
|
|
|
|
|
|
Histograms for layer density appear in **RESULTS** **>** **PLOTS**.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## Hyperparameters
|
|
|
|
|
|
|
|
**ClearML** automatically logs command line options generated with `argparse`, and TensorFlow Definitions.
|
|
|
|
|
|
|
|
Command line options appear in **CONFIGURATIONS** **>** **HYPER PARAMETERS** **>** **Args**.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
TensorFlow Definitions appear in **TF_DEFINE**.
|
|
|
|
|
|
|
|

|
|
|
|
|
2021-05-18 22:31:01 +00:00
|
|
|
## Console
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-05-18 22:31:01 +00:00
|
|
|
Text printed to the console for training progress, as well as all other console output, appear in **RESULTS** **>** **CONSOLE**.
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|

|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-09-02 07:48:37 +00:00
|
|
|
## Configuration Objects
|
2021-05-13 23:48:51 +00:00
|
|
|
|
|
|
|
In the experiment code, a configuration dictionary is connected to the Task by calling the [Task.connect](../../../references/sdk/task.md#connect)
|
|
|
|
method.
|
2021-11-04 09:21:05 +00:00
|
|
|
|
2021-05-13 23:48:51 +00:00
|
|
|
```python
|
|
|
|
task.connect_configuration({'test': 1337, 'nested': {'key': 'value', 'number': 1}})
|
|
|
|
```
|
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|
It appears in **CONFIGURATIONS** **>** **CONFIGURATION OBJECTS** **>** **General**.
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-11-04 09:21:05 +00:00
|
|
|

|