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

Grad_cam++的实现和原文的计算公式不一致,请问怎么理解 #35

Open
zgf6781882 opened this issue Jan 19, 2021 · 3 comments

Comments

@zgf6781882
Copy link

    norm_factor = np.sum(gradient, axis=(1, 2))  # [C]归一化
    for i in range(len(norm_factor)):
        norm_factor[i] = 1. / norm_factor[i] if norm_factor[i] > 0. else 0.  # 避免除零
    alpha = indicate * norm_factor[:, np.newaxis, np.newaxis]  # [C,H,W]

请问怎么理解alpha的计算啊?

@yizt
Copy link
Owner

yizt commented Jan 21, 2021

image

@zgf6781882 以上是计算一个通道的alpha过程示例

@zhailei-zl
Copy link

您好,这部分alpha的计算中,和原论文公式怎么对应呢,原论文中的alpha计算中分母含有梯度乘特征图并进行求和

@mlerma54
Copy link

Hello, this way of computing the alphas will cause all weights to be 1, and does not mach the original paper (eq. 19 in https://arxiv.org/abs/1710.11063). Can you please elaborate? Thank you!

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

4 participants