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

论文公式2 #6

Closed
SiriusXT opened this issue Jan 18, 2021 · 5 comments
Closed

论文公式2 #6

SiriusXT opened this issue Jan 18, 2021 · 5 comments

Comments

@SiriusXT
Copy link

论文公式2
图片和代码
alpha = torch.matmul(torch.cat([extra_vector.unsqueeze(2).repeat(1, 1, neighbor_vector.shape[2], 1),
neighbor_vector, neighbor_weight.unsqueeze(-1)], -1), self.w_1).squeeze(-1) 不一致,感觉论文公式有误?

@Mikrokosmos1997
Copy link
Collaborator

感谢对我们工作的关注!
我们的疏忽导致出现不一致,我们按照论文中的公式描述重新修改了代码并进行了测试,更新后的代码将在这几天上传。

@SiriusXT
Copy link
Author

SiriusXT commented Jan 19, 2021

感谢对我们工作的关注!
我们的疏忽导致出现不一致,我们按照论文中的公式描述重新修改了代码并进行了测试,更新后的代码将在这几天上传。

感谢您的回复!
另外,文中所提及的反向位置嵌入觉得挺有道理,但是代码中似乎并未体现出反向。

@Mikrokosmos1997
Copy link
Collaborator

在utils.py文件的handle_data()函数中,我们对原序列进行了反转,这样在与位置向量的计算过程中,第一个位置向量对应着最后一个物品,第二个位置向量对应倒数第二个物品......
我们认为反转原序列比反转位置向量更加简单,同时两种方式都能达到反向位置嵌入的目标。

@SiriusXT
Copy link
Author

还有一个问题:论文公式3对会话的的求和在代码中体现了,但是对会话的求平均却没发现?

@Mikrokosmos1997
Copy link
Collaborator

感谢指出。在最新的更新中,已经针对这两点进行修改,使得代码和论文中公式一致。

@SiriusXT SiriusXT closed this as completed Feb 2, 2021
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