Layer Statistics

Layer Statistics

Benanza provides an easy way to get statistics of the models. Benanza will read the model(s) and perform aggregations to count the number of layers and other useful information. The model_path can be a folder. In this case, the tool will find all models within the folder and compute the statistics for each model. The outputs are placed in output_path based on the model’s name. For example, we can get the layer statistics for all models using

#benanza layerstats -h
Usage:
  benanza layerstats [flags]

Aliases:
  layerstats, stats

Flags:
  -h, --help   help for layerstats

Global Flags:
  -b, --batch_size int       batch size (default 1)
  -f, --format string        print format to use (default "automatic")
      --full                 print all information about the layers
      --human                print flops in human form
  -d, --model_dir string     model directory
  -p, --model_path string    path to the model prototxt file
      --no_header            show header labels for output
  -o, --output_file string   output file name
benanza layerstats --model_path //models/path -f csv

This outputs a set of CSV files which can be used to create the following plot:

You can also output the data in JSON, TeX, or markdown table format. Here we output the layer statistics for AlexNet in JSON format

benanza layerstats --model_path //AlexNet --output_path assets/layer_stats --format json

The output is shown here:

Layer Statistics by Year

You can also get the layer statistics by year

benanza year_info
YEARTOTALUNIQUE
20101211
2012561163
20134734
2014349129
20151577190
20162286459
2017510127
201841245

This is used to create the plot

Model Plot

The layer stats can also plot the model. You can generate a plot of AlexNet using:

benanza layerstats --model_path //BVLC_AlexNet --format dot -o /tmp/alexnet.dot

Which can be processed using dot to produce.

strict digraph {
  graph [
    rankdir="LR"
    overlap=prism
    overlap_shrink=true
    splines=curved
  ];
  node [
    shape=Mrecord
  ];
  edge [
    penwidth=3
  ];

  // Node definitions.
  "data_0" [
    id=0
    name="data_0"
    type=constant_input
    label="data_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_w_0" [
    id=1
    name="conv1_w_0"
    type=constant_input
    label="conv1_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_b_0" [
    id=2
    name="conv1_b_0"
    type=constant_input
    label="conv1_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_1" [
    id=3
    name="conv1_1"
    type=Conv
    label="{conv_1}  | {CONV}"
    inputs="data_0;conv1_w_0;conv1_b_0"
    outputs="conv1_1"
    penwidth=3
    style=filled
    color="#b48eab"
    fontcolor="#000000"
    fillcolor="#c7a1bf"
  ];
  "conv1_2" [
    id=4
    name="conv1_2"
    type=Relu
    label="{relu_1}  | {RELU}"
    inputs="conv1_1"
    outputs="conv1_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "norm1_1" [
    id=5
    name="norm1_1"
    type=LRN
    label="{lrn_1}  | {LRN}"
    inputs="conv1_2"
    outputs="norm1_1"
    penwidth=3
    style=filled
    color="#b981cf"
    fontcolor="#000000"
    fillcolor="#cc93e3"
  ];
  "pool1_1" [
    id=6
    name="pool1_1"
    type=MaxPool
    label="{maxpool_1}  | {MXPL}"
    inputs="norm1_1"
    outputs="pool1_1"
    penwidth=3
    style=filled
    color="#88abc9"
    fontcolor="#000000"
    fillcolor="#9cc0de"
  ];
  "conv2_w_0" [
    id=7
    name="conv2_w_0"
    type=constant_input
    label="conv2_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv2_b_0" [
    id=8
    name="conv2_b_0"
    type=constant_input
    label="conv2_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv2_1" [
    id=9
    name="conv2_1"
    type=Conv
    label="{conv2_2}  | {CONV}"
    inputs="pool1_1;conv2_w_0;conv2_b_0"
    outputs="conv2_1"
    penwidth=3
    style=filled
    color="#b48eab"
    fontcolor="#000000"
    fillcolor="#c7a1bf"
  ];
  "conv2_2" [
    id=10
    name="conv2_2"
    type=Relu
    label="{relu_2}  | {RELU}"
    inputs="conv2_1"
    outputs="conv2_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "norm2_1" [
    id=11
    name="norm2_1"
    type=LRN
    label="{lrn_2}  | {LRN}"
    inputs="conv2_2"
    outputs="norm2_1"
    penwidth=3
    style=filled
    color="#b981cf"
    fontcolor="#000000"
    fillcolor="#cc93e3"
  ];
  "pool2_1" [
    id=12
    name="pool2_1"
    type=MaxPool
    label="{maxpool_2}  | {MXPL}"
    inputs="norm2_1"
    outputs="pool2_1"
    penwidth=3
    style=filled
    color="#88abc9"
    fontcolor="#000000"
    fillcolor="#9cc0de"
  ];
  "conv3_w_0" [
    id=13
    name="conv3_w_0"
    type=constant_input
    label="conv3_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv3_b_0" [
    id=14
    name="conv3_b_0"
    type=constant_input
    label="conv3_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv3_1" [
    id=15
    name="conv3_1"
    type=Conv
    label="{conv_3}  | {CONV}"
    inputs="pool2_1;conv3_w_0;conv3_b_0"
    outputs="conv3_1"
    penwidth=3
    style=filled
    color="#b48eab"
    fontcolor="#000000"
    fillcolor="#c7a1bf"
  ];
  "conv3_2" [
    id=16
    name="conv3_2"
    type=Relu
    label="{relu_3}  | {RELU}"
    inputs="conv3_1"
    outputs="conv3_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "conv4_w_0" [
    id=17
    name="conv4_w_0"
    type=constant_input
    label="conv4_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv4_b_0" [
    id=18
    name="conv4_b_0"
    type=constant_input
    label="conv4_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv4_1" [
    id=19
    name="conv4_1"
    type=Conv
    label="{conv4_2}  | {CONV}"
    inputs="conv3_2;conv4_w_0;conv4_b_0"
    outputs="conv4_1"
    penwidth=3
    style=filled
    color="#b48eab"
    fontcolor="#000000"
    fillcolor="#c7a1bf"
  ];
  "conv4_2" [
    id=20
    name="conv4_2"
    type=Relu
    label="{relu_4}  | {RELU}"
    inputs="conv4_1"
    outputs="conv4_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "conv5_w_0" [
    id=21
    name="conv5_w_0"
    type=constant_input
    label="conv5_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv5_b_0" [
    id=22
    name="conv5_b_0"
    type=constant_input
    label="conv5_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv5_1" [
    id=23
    name="conv5_1"
    type=Conv
    label="{conv5_2}  | {CONV}"
    inputs="conv4_2;conv5_w_0;conv5_b_0"
    outputs="conv5_1"
    penwidth=3
    style=filled
    color="#b48eab"
    fontcolor="#000000"
    fillcolor="#c7a1bf"
  ];
  "conv5_2" [
    id=24
    name="conv5_2"
    type=Relu
    label="{relu_5}  | {RELU}"
    inputs="conv5_1"
    outputs="conv5_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "pool5_1" [
    id=25
    name="pool5_1"
    type=MaxPool
    label="{maxpool_3}  | {MXPL}"
    inputs="conv5_2"
    outputs="pool5_1"
    penwidth=3
    style=filled
    color="#88abc9"
    fontcolor="#000000"
    fillcolor="#9cc0de"
  ];
  "OC2_DUMMY_1" [
    id=26
    name="OC2_DUMMY_1"
    type=constant_input
    label="OC2_DUMMY_1"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "OC2_DUMMY_0" [
    id=27
    name="OC2_DUMMY_0"
    type=Reshape
    label="{reshape_1}  | {RSHP}"
    inputs="pool5_1;OC2_DUMMY_1"
    outputs="OC2_DUMMY_0"
    penwidth=3
    style=filled
    color="#c69c83"
    fontcolor="#000000"
    fillcolor="#dbb097"
  ];
  "fc6_w_0" [
    id=28
    name="fc6_w_0"
    type=constant_input
    label="fc6_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc6_b_0" [
    id=29
    name="fc6_b_0"
    type=constant_input
    label="fc6_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc6_1" [
    id=30
    name="fc6_1"
    type=Gemm
    label="{gemm_1}  | {GEMM}"
    inputs="OC2_DUMMY_0;fc6_w_0;fc6_b_0"
    outputs="fc6_1"
    penwidth=3
    style=filled
    color="#80beaf"
    fontcolor="#000000"
    fillcolor="#96d5c5"
  ];
  "fc6_2" [
    id=31
    name="fc6_2"
    type=Relu
    label="{relu_6}  | {RELU}"
    inputs="fc6_1"
    outputs="fc6_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "fc6_3" [
    id=32
    name="fc6_3"
    type=Dropout
    label="{dropout_1}  | {DRP}"
    inputs="fc6_2"
    outputs="fc6_3;_fc6_mask_1"
    penwidth=3
    style=filled
    color="#ca84ad"
    fontcolor="#000000"
    fillcolor="#de97c0"
  ];
  "_fc6_mask_1" [
    id=33
    name="_fc6_mask_1"
    type=Dropout
    label="{dropout_1}  | {DRP}"
    inputs="fc6_2"
    outputs="fc6_3;_fc6_mask_1"
    penwidth=3
    style=filled
    color="#ca84ad"
    fontcolor="#000000"
    fillcolor="#de97c0"
  ];
  "fc7_w_0" [
    id=34
    name="fc7_w_0"
    type=constant_input
    label="fc7_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc7_b_0" [
    id=35
    name="fc7_b_0"
    type=constant_input
    label="fc7_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc7_1" [
    id=36
    name="fc7_1"
    type=Gemm
    label="{gemm_2}  | {GEMM}"
    inputs="fc6_3;fc7_w_0;fc7_b_0"
    outputs="fc7_1"
    penwidth=3
    style=filled
    color="#80beaf"
    fontcolor="#000000"
    fillcolor="#96d5c5"
  ];
  "fc7_2" [
    id=37
    name="fc7_2"
    type=Relu
    label="{relu_7}  | {RELU}"
    inputs="fc7_1"
    outputs="fc7_2"
    penwidth=3
    style=filled
    color="#a0c483"
    fontcolor="#000000"
    fillcolor="#b7dc99"
  ];
  "fc7_3" [
    id=38
    name="fc7_3"
    type=Dropout
    label="{dropout_2}  | {DRP}"
    inputs="fc7_2"
    outputs="fc7_3;_fc7_mask_1"
    penwidth=3
    style=filled
    color="#ca84ad"
    fontcolor="#000000"
    fillcolor="#de97c0"
  ];
  "_fc7_mask_1" [
    id=39
    name="_fc7_mask_1"
    type=Dropout
    label="{dropout_2}  | {DRP}"
    inputs="fc7_2"
    outputs="fc7_3;_fc7_mask_1"
    penwidth=3
    style=filled
    color="#ca84ad"
    fontcolor="#000000"
    fillcolor="#de97c0"
  ];
  "fc8_w_0" [
    id=40
    name="fc8_w_0"
    type=constant_input
    label="fc8_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc8_b_0" [
    id=41
    name="fc8_b_0"
    type=constant_input
    label="fc8_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc8_1" [
    id=42
    name="fc8_1"
    type=Gemm
    label="{gemm_3}  | {GEMM}"
    inputs="fc7_3;fc8_w_0;fc8_b_0"
    outputs="fc8_1"
    penwidth=3
    style=filled
    color="#80beaf"
    fontcolor="#000000"
    fillcolor="#96d5c5"
  ];
  "prob_1" [
    id=43
    name="prob_1"
    type=Softmax
    label="{softmax_1}  | {SFT}"
    inputs="fc8_1"
    outputs="prob_1"
    penwidth=3
    style=filled
    color="#8d88c7"
    fontcolor="#000000"
    fillcolor="#9f99d9"
  ];

  // Edge definitions.
  "data_0" -> "conv1_1";
  "conv1_w_0" -> "conv1_1";
  "conv1_b_0" -> "conv1_1";
  "conv1_1" -> "conv1_2";
  "conv1_2" -> "norm1_1";
  "norm1_1" -> "pool1_1";
  "pool1_1" -> "conv2_1";
  "conv2_w_0" -> "conv2_1";
  "conv2_b_0" -> "conv2_1";
  "conv2_1" -> "conv2_2";
  "conv2_2" -> "norm2_1";
  "norm2_1" -> "pool2_1";
  "pool2_1" -> "conv3_1";
  "conv3_w_0" -> "conv3_1";
  "conv3_b_0" -> "conv3_1";
  "conv3_1" -> "conv3_2";
  "conv3_2" -> "conv4_1";
  "conv4_w_0" -> "conv4_1";
  "conv4_b_0" -> "conv4_1";
  "conv4_1" -> "conv4_2";
  "conv4_2" -> "conv5_1";
  "conv5_w_0" -> "conv5_1";
  "conv5_b_0" -> "conv5_1";
  "conv5_1" -> "conv5_2";
  "conv5_2" -> "pool5_1";
  "pool5_1" -> "OC2_DUMMY_0";
  "OC2_DUMMY_1" -> "OC2_DUMMY_0";
  "OC2_DUMMY_0" -> "fc6_1";
  "fc6_w_0" -> "fc6_1";
  "fc6_b_0" -> "fc6_1";
  "fc6_1" -> "fc6_2";
  "fc6_2" -> "fc6_3";
  "fc6_2" -> "_fc6_mask_1";
  "fc6_3" -> "fc7_1";
  "fc7_w_0" -> "fc7_1";
  "fc7_b_0" -> "fc7_1";
  "fc7_1" -> "fc7_2";
  "fc7_2" -> "fc7_3";
  "fc7_2" -> "_fc7_mask_1";
  "fc7_3" -> "fc8_1";
  "fc8_w_0" -> "fc8_1";
  "fc8_b_0" -> "fc8_1";
  "fc8_1" -> "prob_1";
}

The output is dependent on the batch size, so we can modify the batch size and examine the layer shapes. Here we draw the graph using 256 as the batch size .

benanza layerstats --model_path //BVLC_AlexNet --format dot -o /tmp/alexnet.dot --batch_size=256

The graph topology is the same, but has different input/output shapes

strict digraph {
  graph [
    rankdir="LR"
    overlap=prism
    overlap_shrink=true
    splines=curved
  ];
  node [
    shape=Mrecord
  ];
  edge [
    penwidth=3
  ];

  // Node definitions.
  "data_0" [
    id=0
    name="data_0"
    type=constant_input
    label="data_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_w_0" [
    id=1
    name="conv1_w_0"
    type=constant_input
    label="conv1_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_b_0" [
    id=2
    name="conv1_b_0"
    type=constant_input
    label="conv1_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv1_1" [
    id=3
    name="conv1_1"
    type=Conv
    label="{conv_1}  | {CONV}"
    inputs="data_0;conv1_w_0;conv1_b_0"
    outputs="conv1_1"
    penwidth=3
    style=filled
    color="#88c883"
    fontcolor="#000000"
    fillcolor="#9fdf99"
  ];
  "conv1_2" [
    id=4
    name="conv1_2"
    type=Relu
    label="{relu_1}  | {RELU}"
    inputs="conv1_1"
    outputs="conv1_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "norm1_1" [
    id=5
    name="norm1_1"
    type=LRN
    label="{lrn_1}  | {LRN}"
    inputs="conv1_2"
    outputs="norm1_1"
    penwidth=3
    style=filled
    color="#938ac4"
    fontcolor="#000000"
    fillcolor="#a59bd6"
  ];
  "pool1_1" [
    id=6
    name="pool1_1"
    type=MaxPool
    label="{maxpool_1}  | {MXPL}"
    inputs="norm1_1"
    outputs="pool1_1"
    penwidth=3
    style=filled
    color="#83bca4"
    fontcolor="#000000"
    fillcolor="#99d3b9"
  ];
  "conv2_w_0" [
    id=7
    name="conv2_w_0"
    type=constant_input
    label="conv2_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv2_b_0" [
    id=8
    name="conv2_b_0"
    type=constant_input
    label="conv2_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv2_1" [
    id=9
    name="conv2_1"
    type=Conv
    label="{conv2_2}  | {CONV}"
    inputs="pool1_1;conv2_w_0;conv2_b_0"
    outputs="conv2_1"
    penwidth=3
    style=filled
    color="#88c883"
    fontcolor="#000000"
    fillcolor="#9fdf99"
  ];
  "conv2_2" [
    id=10
    name="conv2_2"
    type=Relu
    label="{relu_2}  | {RELU}"
    inputs="conv2_1"
    outputs="conv2_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "norm2_1" [
    id=11
    name="norm2_1"
    type=LRN
    label="{lrn_2}  | {LRN}"
    inputs="conv2_2"
    outputs="norm2_1"
    penwidth=3
    style=filled
    color="#938ac4"
    fontcolor="#000000"
    fillcolor="#a59bd6"
  ];
  "pool2_1" [
    id=12
    name="pool2_1"
    type=MaxPool
    label="{maxpool_2}  | {MXPL}"
    inputs="norm2_1"
    outputs="pool2_1"
    penwidth=3
    style=filled
    color="#83bca4"
    fontcolor="#000000"
    fillcolor="#99d3b9"
  ];
  "conv3_w_0" [
    id=13
    name="conv3_w_0"
    type=constant_input
    label="conv3_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv3_b_0" [
    id=14
    name="conv3_b_0"
    type=constant_input
    label="conv3_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv3_1" [
    id=15
    name="conv3_1"
    type=Conv
    label="{conv_3}  | {CONV}"
    inputs="pool2_1;conv3_w_0;conv3_b_0"
    outputs="conv3_1"
    penwidth=3
    style=filled
    color="#88c883"
    fontcolor="#000000"
    fillcolor="#9fdf99"
  ];
  "conv3_2" [
    id=16
    name="conv3_2"
    type=Relu
    label="{relu_3}  | {RELU}"
    inputs="conv3_1"
    outputs="conv3_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "conv4_w_0" [
    id=17
    name="conv4_w_0"
    type=constant_input
    label="conv4_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv4_b_0" [
    id=18
    name="conv4_b_0"
    type=constant_input
    label="conv4_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv4_1" [
    id=19
    name="conv4_1"
    type=Conv
    label="{conv4_2}  | {CONV}"
    inputs="conv3_2;conv4_w_0;conv4_b_0"
    outputs="conv4_1"
    penwidth=3
    style=filled
    color="#88c883"
    fontcolor="#000000"
    fillcolor="#9fdf99"
  ];
  "conv4_2" [
    id=20
    name="conv4_2"
    type=Relu
    label="{relu_4}  | {RELU}"
    inputs="conv4_1"
    outputs="conv4_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "conv5_w_0" [
    id=21
    name="conv5_w_0"
    type=constant_input
    label="conv5_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv5_b_0" [
    id=22
    name="conv5_b_0"
    type=constant_input
    label="conv5_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "conv5_1" [
    id=23
    name="conv5_1"
    type=Conv
    label="{conv5_2}  | {CONV}"
    inputs="conv4_2;conv5_w_0;conv5_b_0"
    outputs="conv5_1"
    penwidth=3
    style=filled
    color="#88c883"
    fontcolor="#000000"
    fillcolor="#9fdf99"
  ];
  "conv5_2" [
    id=24
    name="conv5_2"
    type=Relu
    label="{relu_5}  | {RELU}"
    inputs="conv5_1"
    outputs="conv5_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "pool5_1" [
    id=25
    name="pool5_1"
    type=MaxPool
    label="{maxpool_3}  | {MXPL}"
    inputs="conv5_2"
    outputs="pool5_1"
    penwidth=3
    style=filled
    color="#83bca4"
    fontcolor="#000000"
    fillcolor="#99d3b9"
  ];
  "OC2_DUMMY_1" [
    id=26
    name="OC2_DUMMY_1"
    type=constant_input
    label="OC2_DUMMY_1"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "OC2_DUMMY_0" [
    id=27
    name="OC2_DUMMY_0"
    type=Reshape
    label="{reshape_1}  | {RSHP}"
    inputs="pool5_1;OC2_DUMMY_1"
    outputs="OC2_DUMMY_0"
    penwidth=3
    style=filled
    color="#85b0c7"
    fontcolor="#000000"
    fillcolor="#9ac5dd"
  ];
  "fc6_w_0" [
    id=28
    name="fc6_w_0"
    type=constant_input
    label="fc6_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc6_b_0" [
    id=29
    name="fc6_b_0"
    type=constant_input
    label="fc6_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc6_1" [
    id=30
    name="fc6_1"
    type=Gemm
    label="{gemm_1}  | {GEMM}"
    inputs="OC2_DUMMY_0;fc6_w_0;fc6_b_0"
    outputs="fc6_1"
    penwidth=3
    style=filled
    color="#b8c384"
    fontcolor="#000000"
    fillcolor="#d0db9b"
  ];
  "fc6_2" [
    id=31
    name="fc6_2"
    type=Relu
    label="{relu_6}  | {RELU}"
    inputs="fc6_1"
    outputs="fc6_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "fc6_3" [
    id=32
    name="fc6_3"
    type=Dropout
    label="{dropout_1}  | {DRP}"
    inputs="fc6_2"
    outputs="fc6_3;_fc6_mask_1"
    penwidth=3
    style=filled
    color="#c68798"
    fontcolor="#000000"
    fillcolor="#da99ab"
  ];
  "_fc6_mask_1" [
    id=33
    name="_fc6_mask_1"
    type=Dropout
    label="{dropout_1}  | {DRP}"
    inputs="fc6_2"
    outputs="fc6_3;_fc6_mask_1"
    penwidth=3
    style=filled
    color="#c68798"
    fontcolor="#000000"
    fillcolor="#da99ab"
  ];
  "fc7_w_0" [
    id=34
    name="fc7_w_0"
    type=constant_input
    label="fc7_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc7_b_0" [
    id=35
    name="fc7_b_0"
    type=constant_input
    label="fc7_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc7_1" [
    id=36
    name="fc7_1"
    type=Gemm
    label="{gemm_2}  | {GEMM}"
    inputs="fc6_3;fc7_w_0;fc7_b_0"
    outputs="fc7_1"
    penwidth=3
    style=filled
    color="#b8c384"
    fontcolor="#000000"
    fillcolor="#d0db9b"
  ];
  "fc7_2" [
    id=37
    name="fc7_2"
    type=Relu
    label="{relu_7}  | {RELU}"
    inputs="fc7_1"
    outputs="fc7_2"
    penwidth=3
    style=filled
    color="#c084ca"
    fontcolor="#000000"
    fillcolor="#d497de"
  ];
  "fc7_3" [
    id=38
    name="fc7_3"
    type=Dropout
    label="{dropout_2}  | {DRP}"
    inputs="fc7_2"
    outputs="fc7_3;_fc7_mask_1"
    penwidth=3
    style=filled
    color="#c68798"
    fontcolor="#000000"
    fillcolor="#da99ab"
  ];
  "_fc7_mask_1" [
    id=39
    name="_fc7_mask_1"
    type=Dropout
    label="{dropout_2}  | {DRP}"
    inputs="fc7_2"
    outputs="fc7_3;_fc7_mask_1"
    penwidth=3
    style=filled
    color="#c68798"
    fontcolor="#000000"
    fillcolor="#da99ab"
  ];
  "fc8_w_0" [
    id=40
    name="fc8_w_0"
    type=constant_input
    label="fc8_w_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc8_b_0" [
    id=41
    name="fc8_b_0"
    type=constant_input
    label="fc8_b_0"
    inputs=""
    outputs=""
    shape=box
    style="filled,dashed"
    fillcolor="white"
  ];
  "fc8_1" [
    id=42
    name="fc8_1"
    type=Gemm
    label="{gemm_3}  | {GEMM}"
    inputs="fc7_3;fc8_w_0;fc8_b_0"
    outputs="fc8_1"
    penwidth=3
    style=filled
    color="#b8c384"
    fontcolor="#000000"
    fillcolor="#d0db9b"
  ];
  "prob_1" [
    id=43
    name="prob_1"
    type=Softmax
    label="{softmax_1}  | {SFT}"
    inputs="fc8_1"
    outputs="prob_1"
    penwidth=3
    style=filled
    color="#c2a081"
    fontcolor="#000000"
    fillcolor="#d7b495"
  ];

  // Edge definitions.
  "data_0" -> "conv1_1";
  "conv1_w_0" -> "conv1_1";
  "conv1_b_0" -> "conv1_1";
  "conv1_1" -> "conv1_2";
  "conv1_2" -> "norm1_1";
  "norm1_1" -> "pool1_1";
  "pool1_1" -> "conv2_1";
  "conv2_w_0" -> "conv2_1";
  "conv2_b_0" -> "conv2_1";
  "conv2_1" -> "conv2_2";
  "conv2_2" -> "norm2_1";
  "norm2_1" -> "pool2_1";
  "pool2_1" -> "conv3_1";
  "conv3_w_0" -> "conv3_1";
  "conv3_b_0" -> "conv3_1";
  "conv3_1" -> "conv3_2";
  "conv3_2" -> "conv4_1";
  "conv4_w_0" -> "conv4_1";
  "conv4_b_0" -> "conv4_1";
  "conv4_1" -> "conv4_2";
  "conv4_2" -> "conv5_1";
  "conv5_w_0" -> "conv5_1";
  "conv5_b_0" -> "conv5_1";
  "conv5_1" -> "conv5_2";
  "conv5_2" -> "pool5_1";
  "pool5_1" -> "OC2_DUMMY_0";
  "OC2_DUMMY_1" -> "OC2_DUMMY_0";
  "OC2_DUMMY_0" -> "fc6_1";
  "fc6_w_0" -> "fc6_1";
  "fc6_b_0" -> "fc6_1";
  "fc6_1" -> "fc6_2";
  "fc6_2" -> "fc6_3";
  "fc6_2" -> "_fc6_mask_1";
  "fc6_3" -> "fc7_1";
  "fc7_w_0" -> "fc7_1";
  "fc7_b_0" -> "fc7_1";
  "fc7_1" -> "fc7_2";
  "fc7_2" -> "fc7_3";
  "fc7_2" -> "_fc7_mask_1";
  "fc7_3" -> "fc8_1";
  "fc8_w_0" -> "fc8_1";
  "fc8_b_0" -> "fc8_1";
  "fc8_1" -> "prob_1";
}

The method by which to generate a plot which also displays the layer shapes is described in the layer shape information section.