Project-MONAI / Project-MONAI/MONAI

gradient-based saliency maps to support different activations

Open
#6,057 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution wanted Feature request
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.