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

inquiry on attention part #5

Open
Derekkk opened this issue Jan 30, 2019 · 1 comment
Open

inquiry on attention part #5

Derekkk opened this issue Jan 30, 2019 · 1 comment

Comments

@Derekkk
Copy link

Derekkk commented Jan 30, 2019

Hi there,

Thanks for sharing the code. For attention part in model.py, your code is:

attentionSoft_b = tf.nn.softmax(tf.transpose(attentionWeights))
attentionSoft_b = tf.transpose(attentionSoft_b) 

while I feel like it should be:
attentionSoft_b = tf.nn.softmax(attentionWeights, axis=1)

or you should indicate the "perm" in transpose function.

Please correct me if I'm wrong, thanks!

@randomtutu
Copy link

u r right .
tf.transpose() would trans all tha axis of the tensor. such as [4,3,2] ——>[2,3,4]

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

No branches or pull requests

2 participants