Add visualization section to docs

This commit is contained in:
Julien Rebetez 2015-11-20 11:03:31 +01:00
parent c1b54159b8
commit 71b258d21e
2 changed files with 21 additions and 0 deletions

@ -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

@ -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'))
```