Project-MONAI / Project-MONAI/MONAI
gradient-based saliency maps to support different activations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.7k
- Forks
- 1.6k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 20
Description
class GuidedBackpropGrad(VanillaGrad):
def __call__(self, x: torch.Tensor, index: torch.Tensor | int | None = None, **kwargs) -> torch.Tensor:
with replace_modules_temp(self.model, "relu", _GradReLU(), strict_match=False):
return super().__call__(x, index, **kwargs)
I think the method tries to look for "relu" layers and replace it with a grad-hooked customised one. This assumingly might not work with other activation functions. this is a feature request to support different activation functions, SiLU for instance.
Originally posted by @trinhdhk in https://github.com/Project-MONAI/MONAI/discussions/6012#discussioncomment-5047022
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with GuidedBackpropGrad.call, the temporary replace_modules_temp call, and the _GradReLU implementation shown in the issue. Determine how activation replacement currently works, then define support for SiLU and other activation functions; done means gradient-based saliency maps work with those activations and the relevant behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100