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

I was trying to run this code but got this error. See pic below #19

Open
ArcherZJ opened this issue Nov 18, 2020 · 4 comments
Open

I was trying to run this code but got this error. See pic below #19

ArcherZJ opened this issue Nov 18, 2020 · 4 comments

Comments

@ArcherZJ
Copy link

image

@TTTiko
Copy link

TTTiko commented Nov 28, 2020

image
i have the same problem! Have you solved it? And if you have solved it ,can you teach me the method?thanks a lot

@TTTiko
Copy link

TTTiko commented Nov 28, 2020

@huntingingit 请问您的问题有得到解决吗 我也遇到了同样的问题,如果解决了的话,能否告知一下方法

@imSeaton
Copy link

@huntingingit 请问您的问题有得到解决吗 我也遇到了同样的问题,如果解决了的话,能否告知一下方法
解决表象的方式是这样的,首先squash函数那里,s = (mag_sq / (1.0 + mag_sq)) * (s / mag + 1e-8) 添加个1e-8, 然后在动态路由方法里给b做一个归一化b_max = torch.max(b_ij, dim=2, keepdim=True) ; b_ij = b_ij / b_max.values (这部分是其他人提出来的,实际上应该是放大b的值)

如果你这么改了确实可以改变0除问题,但是会发现分类结果是33%(总共就3个类别,这1/3的准确率不就是猜的嘛)。我认为本这个代码本质的原因还是他的随意用了很多view操作,打乱了数据,刚好主要胶囊的数量太多,又多又乱的数据导致了模型学不出有用的东西,b都是非常小的数,现梯度消失的问题。

我的建议是参考他的框架,函数的实现还是自己写比较好。

可以一起交流呀,QQ:1038774332

@TTTiko
Copy link

TTTiko commented Dec 19, 2020 via email

Repository owner deleted a comment from shamnastv Feb 19, 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

3 participants