File size: 1,275 Bytes
578b6a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
digraph G {

    // Main styles
    nodesep=0.3; ranksep=0.15;

    node [shape=rect, fillcolor=darkorange, color=white, style=filled, fontsize=11, fontname="arial", height=0.2];
    edge [color=gray, arrowsize=0.5];

    // Layout
    {rank=same;input;prev_hidden;encoder_outputs}


    input -> embedding;
    embedding -> dropout;
    dropout -> embedded;

    embedded -> attn;
    prev_hidden -> attn;
    attn -> attn_softmax;
    attn_softmax -> attn_weights;
    attn_weights -> bmm;
    encoder_outputs -> bmm;
    bmm -> attn_applied;
    attn_applied -> attn_combine;
    embedded -> attn_combine;

    attn_combine -> relu -> gru;
    prev_hidden -> gru;
    gru -> out;
    gru -> hidden;

    out -> softmax;
    softmax -> output;

    {rank=same;output;hidden}

    // Layer nodes
    embedding [fillcolor=dodgerblue, fontcolor=white];
    attn [fillcolor=dodgerblue, fontcolor=white];
    attn_combine [fillcolor=dodgerblue, fontcolor=white];
    bmm [fillcolor=dodgerblue, fontcolor=white];
    gru [fillcolor=dodgerblue, fontcolor=white];
    out [fillcolor=dodgerblue, fontcolor=white];

    // Function nodes
    dropout [fillcolor=palegreen];
    relu [fillcolor=palegreen];
    softmax [fillcolor=palegreen];
    attn_softmax [fillcolor=palegreen];

}