Merge script and ipynb example docs (#101)

This commit is contained in:
pollfly 2021-11-04 11:21:05 +02:00 committed by GitHub
parent 1960a5b632
commit 5e7e6fe7c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 102 deletions

View File

@ -45,8 +45,7 @@ Check out some of ClearML's automatic reporting examples for supported packages:
* [TensorBoardX](../guides/frameworks/tensorboardx/tensorboardx.md) - logging TensorBoardX scalars, debug
samples, and text in code using PyTorch
* Matplotlib
* [Matplotlib Script Example](../guides/frameworks/matplotlib/matplotlib_example.md) and [Jupyter Notebook](../guides/frameworks/matplotlib/allegro_clearml_matplotlib_example.md) -
logging scatter diagrams plotted with Matplotlib
* [Matplotlib](../guides/frameworks/matplotlib/matplotlib_example.md) - logging scatter diagrams plotted with Matplotlib
* [Matplotlib with PyTorch](../guides/frameworks/pytorch/pytorch_matplotlib.md) - logging debug images shown
by Matplotlib

View File

@ -1,47 +0,0 @@
---
title: Keras with TensorBoard - Jupyter Notebook
---
The [ClearML_keras_TB_example.ipynb](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/jupyter_keras_TB_example.ipynb)
example demonstrates **ClearML** automatically logging code, which is running in Jupyter Notebook and is using Keras and TensorBoard.
The example script does the following:
1. Trains a simple deep neural network on the Keras built-in [MNIST](https://keras.io/api/datasets/mnist/#load_data-function)
dataset.
1. Builds a sequential model using a categorical crossentropy 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 `Colab notebooks` project.
:::note
In the ``clearml`` GitHub repository, this example includes a clickable icon to open the notebook in Google Colab.
:::
## Scalars
The loss and accuracy metric scalar plots appear in **RESULTS** **>** **SCALARS**, along with the resource utilization plots,
which are titled **:monitor: machine**.
![image](../../../img/examples_keras_01.png)
## Histograms
Histograms for layer density appear in **RESULTS** **>** **PLOTS**.
![image](../../../img/examples_keras_02.png)
## Hyperparameters
**ClearML** automatically logs TensorFlow Definitions, which appear in **CONFIGURATIONS** **>** **HYPER PARAMETERS** **>** **TF_DEFINE**.
![image](../../../img/examples_keras_00a.png)
## Log
Text printed to the console for training progress, as well as all other console output, appear in **RESULTS** **>** **CONSOLE**.
![image](../../../img/keras_colab_01.png)
## Configuration Objects
The configuration appears in **CONFIGURATIONS** **>** **CONFIGURATION OBJECTS** **>** **General**.
![image](../../../img/keras_colab_02.png)

View File

@ -8,7 +8,7 @@ demonstrates **ClearML**'s automatic logging of code running in a Jupyter Notebo
The example does the following:
1. Trains a simple deep neural network on the Keras built-in [MNIST](https://keras.io/api/datasets/mnist/#load_data-function)
dataset.
1. Builds a sequential model using a categorical crossentropy loss objective function.
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.

View File

@ -2,23 +2,28 @@
title: Keras with TensorBoard
---
The [keras_tensorboard.py](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/keras_tensorboard.py)
example demonstrates the integration of **ClearML** into code which uses Keras and TensorBoard.
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)
or in [Jupyter Notebook](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/jupyter_keras_TB_example.ipynb)
The example does the following:
:::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:
1. Trains a simple deep neural network on the Keras built-in [MNIST](https://keras.io/api/datasets/mnist/#load_data-function)
dataset.
1. Builds a sequential model using a categorical crossentropy 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, it creates an experiment named `Keras with TensorBoard example` which is associated with the
`examples` project.
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) .
## Scalars
The loss and accuracy metric scalar plots appear in the **RESULTS** **>** **SCALARS**, along with the resource utilization
plots, which are titled **:monitor: machine**.
The loss and accuracy metric scalar plots appear in **RESULTS** **>** **SCALARS**, along with the resource utilization plots,
which are titled **:monitor: machine**.
![image](../../../img/examples_keras_01.png)
@ -44,16 +49,17 @@ TensorFlow Definitions appear in **TF_DEFINE**.
Text printed to the console for training progress, as well as all other console output, appear in **RESULTS** **>** **CONSOLE**.
![image](../../../img/examples_keras_03.png)
![image](../../../img/keras_colab_01.png)
## Configuration Objects
In the experiment code, a configuration dictionary is connected to the Task by calling the [Task.connect](../../../references/sdk/task.md#connect)
method.
```python
task.connect_configuration({'test': 1337, 'nested': {'key': 'value', 'number': 1}})
```
It appears in **CONFIGURATIONS** **>** **CONFIGURATION OBJECTS**.
It appears in **CONFIGURATIONS** **>** **CONFIGURATION OBJECTS** **>** **General**.
![image](../../../img/examples_keras_00b.png)
![image](../../../img/keras_colab_02.png)

View File

@ -1,32 +0,0 @@
---
title: Matplotlib - Jupyter Notebook
---
The [jupyter_matplotlib_example.ipynb](https://github.com/allegroai/clearml/blob/master/examples/frameworks/matplotlib/jupyter_matplotlib_example.ipynb)
example demonstrates the integration of **ClearML** into code running in Jupyter Notebook, which uses `matplotlib` to plot
scatter diagrams, and show images. **ClearML** automatically logs the diagrams and images. When the script runs, ClearML
creates an experiment named `Matplotlib example` which is associated with the `Colab notebooks` project.
:::note
In the ``clearml`` GitHub repository, this example includes a clickable icon to open the notebook in Google Colab.
:::
## Plots
The scatter plots appear in the **ClearML Web UI**, in **RESULTS** **>** **PLOTS**.
![image](../../../img/examples_matplotlib_example_01.png)
![image](../../../img/examples_matplotlib_example_02.png)
![image](../../../img/examples_matplotlib_example_03.png)
## Debug Samples
The images appear in **RESULTS** **>** **DEBUG SAMPLES**. Each debug sample image is associated with a metric.
![image](../../../img/examples_matplotlib_example_04.png)
View the debug sample in the image viewer.
![image](../../../img/examples_matplotlib_example_05.png)

View File

@ -2,10 +2,21 @@
title: Matplotlib
---
The [matplotlib_example.py](https://github.com/allegroai/clearml/blob/master/examples/frameworks/matplotlib/matplotlib_example.py)
example demonstrates integrating **ClearML** into code that uses `matplotlib` to plot scatter diagrams, and show images.
**ClearML** automatically logs the diagrams and images. When the script runs, it creates an experiment named `Matplotlib example`,
which is associated with the `examples` project.
The example below demonstrates integrating **ClearML** into code that uses `matplotlib` to plot scatter diagrams, and
show images. **ClearML** automatically logs the diagrams and images.
View the example in [script](https://github.com/allegroai/clearml/blob/master/examples/frameworks/matplotlib/matplotlib_example.py)
or in [Jupyter Notebook](https://github.com/allegroai/clearml/blob/master/examples/frameworks/matplotlib/jupyter_matplotlib_example.ipynb).
:::note
The example in [Jupyter Notebook](https://github.com/allegroai/clearml/blob/master/examples/frameworks/matplotlib/jupyter_matplotlib_example.ipynb),
includes a clickable icon to open the notebook in Google Colab.
:::
When the example runs, it creates an experiment named `Matplotlib example`,
which is associated with the `examples` project (in script) or the `Colab notebooks` project (in Jupyter Notebook).
## Plots

View File

@ -67,10 +67,10 @@ module.exports = {
{'Autokeras': ['guides/frameworks/autokeras/integration_autokeras', 'guides/frameworks/autokeras/autokeras_imdb_example']},
{'FastAI': ['guides/frameworks/fastai/fastai_with_tensorboard']},
{
'Keras': ['guides/frameworks/keras/allegro_clearml_keras_tb_example', 'guides/frameworks/keras/jupyter', 'guides/frameworks/keras/keras_tensorboard']
'Keras': ['guides/frameworks/keras/jupyter', 'guides/frameworks/keras/keras_tensorboard']
},
{'LightGBM': ['guides/frameworks/lightgbm/lightgbm_example']},
{'Matplotlib': ['guides/frameworks/matplotlib/allegro_clearml_matplotlib_example', 'guides/frameworks/matplotlib/matplotlib_example']},
{'Matplotlib': ['guides/frameworks/matplotlib/matplotlib_example']},
{'Pytorch':
['guides/frameworks/pytorch/pytorch_distributed_example', 'guides/frameworks/pytorch/pytorch_matplotlib',
'guides/frameworks/pytorch/pytorch_mnist', 'guides/frameworks/pytorch/pytorch_tensorboard', 'guides/frameworks/pytorch/pytorch_tensorboardx',