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

question about aux loss #6

Open
CC2033625919 opened this issue May 25, 2022 · 6 comments
Open

question about aux loss #6

CC2033625919 opened this issue May 25, 2022 · 6 comments

Comments

@CC2033625919
Copy link

CC2033625919 commented May 25, 2022

你好,关于您论文中提到的分类损失我没太弄清楚,该损失函数的主要作用是什么,我在某一数据集上去掉该损失函数后,分类准确率能够达到和加上辅助损失函数一样的准确率,但生成的CAM效果较差,而后者生成的效果较好,这个辅助损失函数对生成CAM的质量有积极影响吗,您能解释下吗,谢谢

@CC2033625919
Copy link
Author

好的,谢谢

@yumingfan-0219
Copy link

请教一个问题,您说的吧aux loss删去指的是什么?是不采用out345相乘+mean的方式而是按正常的分类网络生成预测的向量吗?如果不是的话请指教

@CC2033625919
Copy link
Author

论文的损失是loss =1/2 * loss1(out345相乘+mean,label)+loss2(out5+mean,label),我把aux loss删去指的是loss =loss1(out345相乘+mean,label)

@yumingfan-0219
Copy link

好像作者的代码中没有第二个loss

@CC2033625919
Copy link
Author

哦,说错了,作者的 loss1 = F.cross_entropy(pred1, label)
loss2 = -(torch.softmax(pred1.detach(), dim=1)*torch.log_softmax(pred2, dim=1)).sum(dim=1).mean()
loss = (loss1+loss2)/2
我把loss2给删了

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