Skip to content

Instantly share code, notes, and snippets.

@jbn
Created April 9, 2017 21:57
Show Gist options
  • Save jbn/934dc768b0b11c732e7c5a17ab26bed7 to your computer and use it in GitHub Desktop.
Save jbn/934dc768b0b11c732e7c5a17ab26bed7 to your computer and use it in GitHub Desktop.
Example for `imate` in Slack Channel
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
from keras.models import Sequential
from keras.layers import Dense, Activation
model = Sequential([
Dense(32, input_shape=(784,)),
Activation('relu'),
Dense(10),
Activation('softmax'),
])
with open("my_graph.svg", "wb") as fp:
fp.write(model_to_dot(model).create_svg())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment