Skip to content

NoiseGrad (and its extension NoiseGrad++) is a method to enhance explanations of artificial neural networks by adding noise to model weights

License

Notifications You must be signed in to change notification settings

aaarrti/NoiseGrad

 
 

Repository files navigation

NoiseGrad and FusionGrad

NoiseGrad: enhancing explanations by introducing stochasticity to model weights

Pytorch implementation


Pytorch implementation for "NoiseGrad: enhancing explanations by introducing stochasticity to model weights". The paper introduces two novel methods NoiseGrad and FusionGrad which both improves attribution-based explanations by introducing stochasticity to the model parameters. See arXiv preprint: https://arxiv.org/abs/2106.10185.

Cite this paper

To cite this paper use following Bibtex annotation:

@misc{bykov2021noisegrad,
      title={NoiseGrad: enhancing explanations by introducing stochasticity to model weights},
      author={Kirill Bykov and Anna Hedström and Shinichi Nakajima and Marina M. -C. Höhne},
      year={2021},
      eprint={2106.10185},
      archivePrefix={arXiv},
      primaryClass={cs.LG}}

Installation

pip install noisegrad

All experiments were conducted with Python 3.6.9.

Minimal Example, for more detailed ones, please refer to examples/

from noisegrad import NoiseGrad, NoiseGradConfig, NoiseGradPlusPlus, NoiseGradPlusPlusConfig
from noisegrad.explainers import intgrad_explainer

# Initialize NoiseGrad: enhance any explanation function!
noisegrad = NoiseGrad(NoiseGradConfig(n=5))

# Initialize NoiseGrad++: enhance any explanation function!
noisegradp = NoiseGradPlusPlus(NoiseGradPlusPlusConfig(n=5, m=5))

# Get baseline explanation.
expl_base = intgrad_explainer(model, x, y)

# Get NoiseGrad explanation.
expl_ng = noisegrad.enhance_explanation(model, x, y, intgrad_explainer)

# Get NoiseGrad++ explanation.
expl_ngp = noisegradp.enhance_explanation(model, x, y, intgrad_explainer)

About

NoiseGrad (and its extension NoiseGrad++) is a method to enhance explanations of artificial neural networks by adding noise to model weights

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%