Created
May 26, 2013 15:10
-
-
Save thigm85/5653059 to your computer and use it in GitHub Desktop.
Graphviz script to draw a simple neural network diagram. Copy this to a `file.txt` file and then run `dot -Tpng -O file.txt` from command-line to get a .png figure with the diagram.
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
digraph G { | |
rankdir=LR | |
splines=line | |
node [fixedsize=true, label=""]; | |
subgraph cluster_0 { | |
color=white; | |
node [style=solid,color=blue4, shape=circle]; | |
x1 x2 x3; | |
label = "layer 1 (Input layer)"; | |
} | |
subgraph cluster_1 { | |
color=white; | |
node [style=solid,color=red2, shape=circle]; | |
a12 a22 a32; | |
label = "layer 2 (hidden layer)"; | |
} | |
subgraph cluster_2 { | |
color=white; | |
node [style=solid,color=seagreen2, shape=circle]; | |
O; | |
label="layer 3 (output layer)"; | |
} | |
x1 -> a12; | |
x1 -> a22; | |
x1 -> a32; | |
x2 -> a12; | |
x2 -> a22; | |
x2 -> a32; | |
x3 -> a12; | |
x3 -> a22; | |
x3 -> a32; | |
a12 -> O | |
a22 -> O | |
a32 -> O | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also put it into plantuml.com's renderer, putting @startdot/@enddot around the code.