From f22402933e66776d958158aa036a9d8470f35e9a Mon Sep 17 00:00:00 2001 From: ranqiu Date: Sun, 19 Nov 2017 16:15:34 +0800 Subject: [PATCH] Refine multi_head_attention --- python/paddle/trainer_config_helpers/networks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/trainer_config_helpers/networks.py b/python/paddle/trainer_config_helpers/networks.py index 50c8b9e6e29..d2d844746f4 100644 --- a/python/paddle/trainer_config_helpers/networks.py +++ b/python/paddle/trainer_config_helpers/networks.py @@ -1586,9 +1586,9 @@ def multi_head_attention(query, value_proj, offset=value_proj_size * i, size=value_proj_size) if attention_type == 'dot-product attention': - m = linear_comb_layer( - weights=sub_query_proj, - vectors=sub_key_proj, + m = dot_prod_layer( + input1=sub_query_proj, + input2=sub_key_proj, name='%s_dot-product_%d' % (name, i)) m = slope_intercept_layer( input=m, -- GitLab