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

强化学习使用GradCAM #44

Open
shisi-cc opened this issue May 5, 2021 · 3 comments
Open

强化学习使用GradCAM #44

shisi-cc opened this issue May 5, 2021 · 3 comments

Comments

@shisi-cc
Copy link

shisi-cc commented May 5, 2021

你好,我想尝试在强化学习里用GradCAM,但是遇到一个问题是强化学习里损失函数跟做分类不太一样,我不太确定求GradCAM的梯度时是用强化学习的损失函数,还是像分类一样用最大值做反向,不知道您有没有了解?

@yizt
Copy link
Owner

yizt commented May 7, 2021

@shisi-cc 不太清楚您的问题,可否详细说下您用的网络,然后想用Grad-CAM来具体做什么

@shisi-cc
Copy link
Author

shisi-cc commented May 7, 2021

@yizt 不好意思,好像是我理解错了。我之前以为Grad-CAM中求梯度是用的CrossEntropy之类的损失函数,就跟分类任务一样。后来仔细读了一下论文和代码,梯度是用输出的得分(target = output[0][index] target.backward())做反向传播。那就是说无论网络训练时用的是什么损失函数,都不影响Grad-CAM的求解。不知道我的理解是否正确?

@yizt
Copy link
Owner

yizt commented May 8, 2021

@shisi-cc 对的,跟loss没有关系

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