forked from keras-team/keras
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request keras-team#1046 from julienr/visutil_to_graph
Add visualize_util.to_graph and docs
- Loading branch information
Showing
3 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters