Skip to content

Instantly share code, notes, and snippets.

@piyushghai
Created October 10, 2018 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piyushghai/ad18f1290ec05d96ef5e9631474ae553 to your computer and use it in GitHub Desktop.
Save piyushghai/ad18f1290ec05d96ef5e9631474ae553 to your computer and use it in GitHub Desktop.
LSTM Unroll Name conflict issue
{
"nodes": [
{
"op": "null",
"name": "data",
"inputs": []
},
{
"op": "SliceChannel",
"name": "myblock0_split0",
"attrs": {
"axis": "1",
"num_outputs": "2",
"squeeze_axis": "1"
},
"inputs": [[0, 0, 0]]
},
{
"op": "null",
"name": "myblock0_lstm0_i2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 0)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm0_i2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm0_t0_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[1, 0, 0], [2, 0, 0], [3, 0, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm0_begin_state_0",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm0_h2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 20)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm0_h2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm0_t0_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[5, 0, 0], [6, 0, 0], [7, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm0_t0_plus0",
"inputs": [[4, 0, 0], [8, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm0_t0_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[9, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t0_o",
"inputs": [[10, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t0_f",
"inputs": [[10, 1, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm0_begin_state_1",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t0_mul0",
"inputs": [[12, 0, 0], [13, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t0_i",
"inputs": [[10, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm0_t0_c",
"inputs": [[10, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t0_mul1",
"inputs": [[15, 0, 0], [16, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm0_t0_state",
"inputs": [[14, 0, 0], [17, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm0_activation0",
"attrs": {"act_type": "tanh"},
"inputs": [[18, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t0_out",
"inputs": [[11, 0, 0], [19, 0, 0]]
},
{
"op": "null",
"name": "myblock0_lstm1_i2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 0)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm1_i2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm1_t0_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[20, 0, 0], [21, 0, 0], [22, 0, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm1_begin_state_0",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm1_h2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 20)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm1_h2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm1_t0_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[24, 0, 0], [25, 0, 0], [26, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm1_t0_plus0",
"inputs": [[23, 0, 0], [27, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm1_t0_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[28, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t0_o",
"inputs": [[29, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t0_f",
"inputs": [[29, 1, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm1_begin_state_1",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t0_mul0",
"inputs": [[31, 0, 0], [32, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t0_i",
"inputs": [[29, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm1_t0_c",
"inputs": [[29, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t0_mul1",
"inputs": [[34, 0, 0], [35, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm1_t0_state",
"inputs": [[33, 0, 0], [36, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm1_activation0",
"attrs": {"act_type": "tanh"},
"inputs": [[37, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t0_out",
"inputs": [[30, 0, 0], [38, 0, 0]]
},
{
"op": "null",
"name": "myblock0_lstm2_i2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 0)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm2_i2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm2_t0_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[39, 0, 0], [40, 0, 0], [41, 0, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm2_begin_state_0",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm2_h2h_weight",
"attrs": {
"__dtype__": "0",
"__lr_mult__": "1.0",
"__shape__": "(80, 20)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "null",
"name": "myblock0_lstm2_h2h_bias",
"attrs": {
"__dtype__": "0",
"__init__": "zeros",
"__lr_mult__": "1.0",
"__shape__": "(80,)",
"__storage_type__": "0",
"__wd_mult__": "1.0"
},
"inputs": []
},
{
"op": "FullyConnected",
"name": "myblock0_lstm2_t0_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[43, 0, 0], [44, 0, 0], [45, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm2_t0_plus0",
"inputs": [[42, 0, 0], [46, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm2_t0_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[47, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t0_o",
"inputs": [[48, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t0_f",
"inputs": [[48, 1, 0]]
},
{
"op": "_zeros",
"name": "myblock0_myblock0_lstm2_begin_state_1",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 20)"
},
"inputs": []
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t0_mul0",
"inputs": [[50, 0, 0], [51, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t0_i",
"inputs": [[48, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm2_t0_c",
"inputs": [[48, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t0_mul1",
"inputs": [[53, 0, 0], [54, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm2_t0_state",
"inputs": [[52, 0, 0], [55, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm2_activation0",
"attrs": {"act_type": "tanh"},
"inputs": [[56, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t0_out",
"inputs": [[49, 0, 0], [57, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm0_t1_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[1, 1, 0], [2, 0, 0], [3, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm0_t1_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[20, 0, 0], [6, 0, 0], [7, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm0_t1_plus0",
"inputs": [[59, 0, 0], [60, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm0_t1_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[61, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t1_o",
"inputs": [[62, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t1_f",
"inputs": [[62, 1, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t1_mul0",
"inputs": [[64, 0, 0], [18, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm0_t1_i",
"inputs": [[62, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm0_t1_c",
"inputs": [[62, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t1_mul1",
"inputs": [[66, 0, 0], [67, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm0_t1_state",
"inputs": [[65, 0, 0], [68, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm0_activation1",
"attrs": {"act_type": "tanh"},
"inputs": [[69, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm0_t1_out",
"inputs": [[63, 0, 0], [70, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm1_t1_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[71, 0, 0], [21, 0, 0], [22, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm1_t1_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[39, 0, 0], [25, 0, 0], [26, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm1_t1_plus0",
"inputs": [[72, 0, 0], [73, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm1_t1_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[74, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t1_o",
"inputs": [[75, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t1_f",
"inputs": [[75, 1, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t1_mul0",
"inputs": [[77, 0, 0], [37, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm1_t1_i",
"inputs": [[75, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm1_t1_c",
"inputs": [[75, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t1_mul1",
"inputs": [[79, 0, 0], [80, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm1_t1_state",
"inputs": [[78, 0, 0], [81, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm1_activation1",
"attrs": {"act_type": "tanh"},
"inputs": [[82, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm1_t1_out",
"inputs": [[76, 0, 0], [83, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm2_t1_i2h",
"attrs": {"num_hidden": "80"},
"inputs": [[84, 0, 0], [40, 0, 0], [41, 0, 0]]
},
{
"op": "FullyConnected",
"name": "myblock0_lstm2_t1_h2h",
"attrs": {"num_hidden": "80"},
"inputs": [[58, 0, 0], [44, 0, 0], [45, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm2_t1_plus0",
"inputs": [[85, 0, 0], [86, 0, 0]]
},
{
"op": "SliceChannel",
"name": "myblock0_lstm2_t1_slice",
"attrs": {"num_outputs": "4"},
"inputs": [[87, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t1_o",
"inputs": [[88, 3, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t1_f",
"inputs": [[88, 1, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t1_mul0",
"inputs": [[90, 0, 0], [56, 0, 0]]
},
{
"op": "sigmoid",
"name": "myblock0_lstm2_t1_i",
"inputs": [[88, 0, 0]]
},
{
"op": "tanh",
"name": "myblock0_lstm2_t1_c",
"inputs": [[88, 2, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t1_mul1",
"inputs": [[92, 0, 0], [93, 0, 0]]
},
{
"op": "elemwise_add",
"name": "myblock0_lstm2_t1_state",
"inputs": [[91, 0, 0], [94, 0, 0]]
},
{
"op": "Activation",
"name": "myblock0_lstm2_activation1",
"attrs": {"act_type": "tanh"},
"inputs": [[95, 0, 0]]
},
{
"op": "elemwise_mul",
"name": "myblock0_lstm2_t1_out",
"inputs": [[89, 0, 0], [96, 0, 0]]
},
{
"op": "stack",
"name": "myblock0_stack0",
"attrs": {
"axis": "1",
"num_args": "2"
},
"inputs": [[58, 0, 0], [97, 0, 0]]
}
],
"arg_nodes": [
0,
2,
3,
6,
7,
21,
22,
25,
26,
40,
41,
44,
45
],
"node_row_ptr": [
0,
1,
3,
4,
5,
6,
7,
8,
9,
10,
11,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
108,
109,
110,
111,
112,
113,
114,
115,
116,
117,
118
],
"heads": [[98, 0, 0]],
"attrs": {"mxnet_version": ["int", 10301]}
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment