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_attention #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pengyuchen
Copy link

In multihead-attention model, there should be one more linear projection layer at the end of the output (before residual connection).



# Linear projections
outputs = tf.layers.dense(outputs, num_units, activation=tf.nn.relu) # (N, T_q, C)

Choose a reason for hiding this comment

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

I think you are right about an extra projection, but can I ask about the activation function here? seems in the original paper there is no bias and activation, only a plain "Concat(head1, ..., headh)W_O"

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.

2 participants