Grad-CAM.pytorch icon indicating copy to clipboard operation
Grad-CAM.pytorch copied to clipboard

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

Open zgf6781882 opened this issue 4 years ago • 3 comments

    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的计算啊?

zgf6781882 avatar Jan 19 '21 07:01 zgf6781882

image

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

yizt avatar Jan 21 '21 01:01 yizt

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

zhailei-zl avatar Mar 23 '22 10:03 zhailei-zl

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!

mlerma54 avatar Apr 24 '22 15:04 mlerma54