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

cc_attention def INF #109

Open
ZhangJT0127 opened this issue May 7, 2021 · 3 comments
Open

cc_attention def INF #109

ZhangJT0127 opened this issue May 7, 2021 · 3 comments

Comments

@ZhangJT0127
Copy link

why use INF function?i want to know that.

@Asthestarsfalll
Copy link

@ZhangJT0127
论文中注意力图的其中一个维度是H+W-1,这是因为计算了两次自身所以要减去,在代码中直接使用INF函数来生成负无穷并加在energy_H上,这样使用softmax时就消除了两次计算自身的影响

@Thatboy7
Copy link

@ZhangJT0127 论文中注意力图的其中一个维度是H+W-1,这是因为计算了两次自身所以要减去,在代码中直接使用INF函数来生成负无穷并加在energy_H上,这样使用softmax时就消除了两次计算自身的影响

Is there an another method? the torch.diag methon isn't supported by onnx version and when i use torch.eye ,my tensorrt doesn‘t support it either.

1 similar comment
@Thatboy7
Copy link

@ZhangJT0127 论文中注意力图的其中一个维度是H+W-1,这是因为计算了两次自身所以要减去,在代码中直接使用INF函数来生成负无穷并加在energy_H上,这样使用softmax时就消除了两次计算自身的影响

Is there an another method? the torch.diag methon isn't supported by onnx version and when i use torch.eye ,my tensorrt doesn‘t support it either.

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

3 participants