Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multihead scaled dot product attention. #7791

Merged
merged 10 commits into from
Jan 24, 2018

Conversation

lcy-seso
Copy link
Contributor

@lcy-seso lcy-seso commented Jan 23, 2018

No description provided.

@lcy-seso lcy-seso force-pushed the multihead_attention branch 2 times, most recently from 7442fe0 to 4a24f76 Compare January 23, 2018 11:43
@lcy-seso lcy-seso force-pushed the multihead_attention branch 2 times, most recently from 9c550a9 to c0ac68b Compare January 23, 2018 13:28
guoshengCS
guoshengCS previously approved these changes Jan 23, 2018
Copy link
Contributor

@guoshengCS guoshengCS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

guoshengCS
guoshengCS previously approved these changes Jan 24, 2018
guoshengCS
guoshengCS previously approved these changes Jan 24, 2018
if len(x_shape) == 1:
x_shape = [1] + x_shape
if len(y_shape) == 1:
y_shape = [1] + y_shape
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the rank of y is 1, it is treated as [D, 1] in nontransposed form.

[bs, max_sequence_length, num_heads * hidden_dim].
"""

if len(x.shape) == 3: return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it be return x here.

dot_product_attention
---------------------
scaled_dot_product_attention
----------------------------
.. autofunction:: paddle.v2.fluid.nets.dot_product_attention
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it be paddle.v2.fluid.nets.scaled_dot_product_attention here.

@lcy-seso lcy-seso merged commit 32a5dfd into PaddlePaddle:develop Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants