Grad_cam++的实现和原文的计算公式不一致,请问怎么理解
zgf6781882 opened this issue · 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 以上是计算一个通道的alpha过程示例
您好,这部分alpha的计算中,和原论文公式怎么对应呢,原论文中的alpha计算中分母含有梯度乘特征图并进行求和
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!