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

Questions about the implementation of Grad-CAM++: The second and third order derivatives #557

Open
hxngu opened this issue Feb 20, 2025 · 1 comment

Comments

@hxngu
Copy link

hxngu commented Feb 20, 2025

#541 When I try to learn how to get hessian matrix I find the implementation of Grad-CAM++ just used grads_power_2 = grads**2 and grads_power_3 = grads_power_2 * grads to get the second and third order derivatives. Is that correct? The formula in original paper is listed below.

Image
@caihuaiguang
Copy link

GradCAM++ approximates second and third-order derivatives using squared and cubed gradients, which holds only when logits are passed through an exponential function (i.e., output = exp(logits) ).

Computing the exact Hessian matrix is both time-consuming and space-consuming. However, obtaining the Hessian-vector product requires only a single backward pass, as demonstrated in ShapleyCAM, which is also merged to this repository.

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