From 81abcdea394d4ff0e423e874f705c4680defd21e Mon Sep 17 00:00:00 2001 From: ranqiu Date: Sun, 19 Nov 2017 16:12:43 +0800 Subject: [PATCH] Refine dot_product_attention --- python/paddle/trainer_config_helpers/networks.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/paddle/trainer_config_helpers/networks.py b/python/paddle/trainer_config_helpers/networks.py index d323d34c3ff..cd5a0f6618e 100644 --- a/python/paddle/trainer_config_helpers/networks.py +++ b/python/paddle/trainer_config_helpers/networks.py @@ -1476,10 +1476,8 @@ def dot_product_attention(encoded_sequence, expand_as=encoded_sequence, name='%s_expand' % name) - m = linear_comb_layer( - weights=expanded, - vectors=encoded_sequence, - name='%s_dot-product' % name) + m = dot_prod_layer( + input1=expanded, input2=encoded_sequence, name='%s_dot-product' % name) attention_weight = fc_layer( input=m, -- GitLab