提交 4ad12a0b 编写于 作者: R ranqiu

Fix bugs of dot-product attention

上级 3f1062d7
...@@ -1457,11 +1457,13 @@ def dot_product_attention(encoded_sequence, ...@@ -1457,11 +1457,13 @@ def dot_product_attention(encoded_sequence,
expanded = expand_layer( expanded = expand_layer(
input=transformed_state, input=transformed_state,
expanded_as=encoded_sequence, expand_as=encoded_sequence,
name='%s_expand' % name) name='%s_expand' % name)
m = linear_comb_layer( m = linear_comb_layer(
weights=expanded, vectors=encoded_sequence, name='%s_dot-product') weights=expanded,
vectors=encoded_sequence,
name='%s_dot-product' % name)
attention_weight = fc_layer( attention_weight = fc_layer(
input=m, input=m,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册