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

对代码与论文模型图中的几个疑问 #90

Open
LXXiaogege opened this issue Oct 24, 2021 · 1 comment
Open

对代码与论文模型图中的几个疑问 #90

LXXiaogege opened this issue Oct 24, 2021 · 1 comment

Comments

@LXXiaogege
Copy link

  1. 论文中历史序列在经过attention后,又跟原始历史序列做了product,可是代码里没有体现
  2. 论文中经过attention后又经过了sum pooling然后做的concat,代码里也没有做sum pooling,直接做了concat
  3. attention实现中 out product是用了tf.concat([q, k, q - k, q * k], axis=-1) ,请问为啥这样做啊。

刚刚入门res-sys,疑问可能有点多,希望能帮忙解答一下

@xu-song
Copy link

xu-song commented Aug 2, 2022

  1. 论文中经过attention后又经过了sum pooling然后做的concat,代码里也没有做sum pooling,直接做了concat
    ...

outputs = tf.nn.softmax(outputs) # [B, 1, T]
# Weighted sum
outputs = tf.matmul(outputs, keys) # [B, 1, H]

sum pooling应该指的这里吧,weighted sum

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