Skip to content

Commit aedd183

Browse files
committed
Add skip connections and normalize.
1 parent c638174 commit aedd183

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

test/ParallelReverseAutoDiff.Test/GraphAttentionPaths/EdgeAttention/Architecture/EdgeAttention.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,15 @@
121121
"inputs": [ "reduce", "RB" ],
122122
"gradientResultTo": [ null, "DRB" ]
123123
},
124+
{
125+
"id": "reduce_add_skip",
126+
"type": "BatchAddThreeOperation",
127+
"inputs": [ "reduce_add", "keys_edgeFeatures", "values_edgeFeatures" ]
128+
},
124129
{
125130
"id": "layernorm_reduce",
126131
"type": "BatchLayerNormalizationOperation",
127-
"inputs": [ "reduce_add" ]
132+
"inputs": [ "reduce_add_skip" ]
128133
},
129134
{
130135
"id": "output_act",

test/ParallelReverseAutoDiff.Test/GraphAttentionPaths/GCN/Architecture/MessagePassing.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@
5252
{
5353
"id": "ah_w_act",
5454
"type": "BatchLeakyReLUOperation",
55-
"inputs": [ "ah_w_broadcasting" ],
55+
"inputs": [ "ah_w_broadcasting" ]
56+
},
57+
{
58+
"id": "ah_w_act_softmax",
59+
"type": "BatchSineSoftmaxOperation",
60+
"inputs": [ "ah_w_act" ],
5661
"setResultTo": "Output"
5762
}
5863
]

test/ParallelReverseAutoDiff.Test/GraphAttentionPaths/Readout/Architecture/Readout.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,15 @@
204204
"inputs": [ "reduce", "RB" ],
205205
"gradientResultTo": [ null, "DRB" ]
206206
},
207+
{
208+
"id": "reduce_add_skip",
209+
"type": "BatchMatrixAddThreeOperation",
210+
"inputs": [ "reduce_add", "keys_pathFeatures", "values_pathFeatures" ]
211+
},
207212
{
208213
"id": "layernorm_reduce",
209214
"type": "BatchLayerNormalizationOperation",
210-
"inputs": [ "reduce_add" ]
215+
"inputs": [ "reduce_add_skip" ]
211216
},
212217
{
213218
"id": "output_act",
@@ -226,7 +231,22 @@
226231
{
227232
"id": "output_avg",
228233
"type": "BatchMatrixAverageOperation",
229-
"inputs": [ "pre_output" ],
234+
"inputs": [ "pre_output" ]
235+
},
236+
{
237+
"id": "output_avg_trans",
238+
"type": "MatrixTransposeOperation",
239+
"inputs": [ "output_avg" ]
240+
},
241+
{
242+
"id": "output_avg_softmax",
243+
"type": "BatchSineSoftmaxOperation",
244+
"inputs": [ "output_avg_trans" ]
245+
},
246+
{
247+
"id": "output_avg_softmax_trans",
248+
"type": "MatrixTransposeOperation",
249+
"inputs": [ "output_avg_softmax" ],
230250
"setResultTo": "Output"
231251
}
232252
]

test/ParallelReverseAutoDiff.Test/GraphAttentionPaths/Transformer/Architecture/Transformer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,15 @@
217217
"inputs": [ "reduce", "RB" ],
218218
"gradientResultTo": [ null, "DRB" ]
219219
},
220+
{
221+
"id": "reduce_add_skip",
222+
"type": "MatrixAddThreeOperation",
223+
"inputs": [ "reduce_add", "keys_pathFeatures", "values_pathFeatures" ]
224+
},
220225
{
221226
"id": "layernorm_reduce",
222227
"type": "BatchLayerNormalizationOperation",
223-
"inputs": [ "reduce_add" ]
228+
"inputs": [ "reduce_add_skip" ]
224229
},
225230
{
226231
"id": "output_act",

0 commit comments

Comments
 (0)