Giter Site home page Giter Site logo

kaifishr / pytorchrelevancepropagation Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 4.0 16.45 MB

A basic implementation of Layer-wise Relevance Propagation (LRP) in PyTorch.

Home Page: https://kaifishr.github.io/2021/12/15/relevance-propagation-pytorch.html

Python 100.00%
interactive lrp pytorch real-time relevance-propagation

pytorchrelevancepropagation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pytorchrelevancepropagation's Issues

Confusion about Gradient-based Relevance Computation

Could you please explain the formula for Gradient-based Relevance Computation in more detail, I notice you have explained in your blog.
Part code:

z = self.layer.forward(a) + self.eps
        s = (r / z).data
        (z * s).sum().backward()
        c = a.grad
        r = (a * c).data

Part formula:
image

There are some questions:

  1. Why wij can represent by
    image, and the i' represents what.
    2.sj is also an equation about a, sj is treated as a constant is not correct.
    3.What is the relationship between zj(a; w) and image.

lrp for concatenate layer

Hi @KaiFabi

Look like the lrp layer is worked if the network structure's model is sequential right?. I tried using squeezenet that has FIRE module (contain concatenate layer) got an error channels.

Thanks

lrp for regression

Dear @KaiFabi ,

Thanks for this implementation. I think it is super cool! Can your implementation be used for the regression problem where there is only one output neuron representing a numerical value. How should I change the implementation to do this, if possible?

Looking forward to hearing your comment on this!

Thanks

question in lrp_layers.py

hi @kaifishr
Thanks for your implementation. I'm trying to reimplement lrp on Resnet50, but it has a BatchNorm2D layer in the backbone, I'm a freshman in python and I don't know how to code the RelevancePropagationBatchNorm2D in lrp_layers.py. Can you just give me some ideas? Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.