rnn.dot 2.0 KB
Newer Older
_青葱's avatar
_青葱 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
digraph G {
  label = "simple RNN implementation" 

  ranksep=2;

  //graph [nodesep=1, ranksep=1];

  node[nodesep=1]

  subgraph cluster0 {
    label = "global scope"
    rankdir = TB
    W
    boot_memory
    input
    output
  }

  subgraph cluster1 {
    label = "step-scope 0"
    rankdir = TB
    memory0[label="memory"]
    prememory0[label="pre-memory"]
    step_input0[label="step input"]
    step_output0[label="step output"]
  }

  subgraph cluster2 {
    label = "step-scope 1"
    rankdir = TB
    memory1[label="memory"]
    prememory1[label="pre-memory"]
    step_input1[label="step input"]
    step_output1[label="step output"]
  }

  subgraph cluster3 {
    label = "step-scope 2"
    rankdir = TB
    memory2[label="memory"]
    prememory2[label="pre-memory"]
    step_input2[label="step input"]
    step_output2[label="step output"]
  }

  stepnet [shape=box]
  stepnet0 [shape=box, style=dashed]
  stepnet1 [shape=box, style=dashed]
  stepnet2 [shape=box, style=dashed]


  edge[color=blue]
  boot_memory -> prememory0 [label="init" color="blue"]
  memory0 -> prememory1  [label="copy/reference" color="blue"]
  memory1 -> prememory2 [label="copy/reference" color="blue"]

  edge[color=black]
  W -> stepnet0[constraint=false, style=dashed]
  W -> stepnet1[constraint=false, style=dashed]
  W -> stepnet2[constraint=false, style=dashed]

  memory0 -> stepnet0[style=dashed]
  prememory0 -> stepnet0 -> step_output0[style=dashed]

  memory1 -> stepnet1[style=dashed]
  prememory1 -> stepnet1 -> step_output1[style=dashed]

  memory2 -> stepnet2[style=dashed]
  prememory2 -> stepnet2 -> step_output2[style=dashed]

  input -> step_input0
  input -> step_input1
  input -> step_input2

  step_input0 -> stepnet0 [style=dashed]
  step_input1 -> stepnet1[style=dashed]
  step_input2 -> stepnet2[style=dashed]

  step_output0 -> output
  step_output1 -> output
  step_output2 -> output

  stepnet0 -> stepnet[style=dashed]
  stepnet1 -> stepnet[style=dashed]
  stepnet2 -> stepnet[style=dashed]

}