From 71b258d21ea5bb0dd38e3e845818c34f26c55dee Mon Sep 17 00:00:00 2001 From: Julien Rebetez Date: Fri, 20 Nov 2015 11:03:31 +0100 Subject: [PATCH] Add visualization section to docs --- docs/mkdocs.yml | 1 + docs/sources/visualization.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 docs/sources/visualization.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index cec55d98a..b13a7fd78 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -24,6 +24,7 @@ pages: - Constraints: constraints.md - Callbacks: callbacks.md - Datasets: datasets.md +- Visualization: visualization.md - Layers: - Core Layers: layers/core.md - Convolutional Layers: layers/convolutional.md diff --git a/docs/sources/visualization.md b/docs/sources/visualization.md new file mode 100644 index 000000000..001ddb451 --- /dev/null +++ b/docs/sources/visualization.md @@ -0,0 +1,20 @@ + +## Model visualization + +The `keras.utils.visualize_util` module provides utility functions to plot +a Keras model (using graphviz). + +This will plot a graph of the model and save it to a file: +```python +from keras.utils.visualize_util import plot +plot(model, to_file='model.png') +``` + +You can also directly obtain the `pydot.Graph` object and render it yourself, +for example to show it in an ipython notebook : +```python +from IPython.display import SVG +from keras.utils.visualize_util import to_graph + +SVG(to_graph(model).create(prog='dot', format='svg')) +```