kundajelab / deeplift

Public facing deeplift repo
MIT License
818 stars 162 forks source link

AttributeError: 'MaxPool2D' object has no attribute 'set_scoring_mode' #82

Open MuskaanJain opened 5 years ago

MuskaanJain commented 5 years ago

I am using a VGG16 model with "include_top=False" i.e. having Maxpool2D as its last layer. Is Maxpool2D as the target layer not possible or it is just not implemented?

AvantiShri commented 5 years ago

Just not implemented. If you were to conduct interpretation, would you do it with respect to a single neuron in the maxpooling output? Or would you do it with respect to some combination of output neurons?

On Thu, Jun 6, 2019 at 2:01 AM Muskaan Jain notifications@github.com wrote:

I am using a VGG16 model with "include_top=False" i.e. having Maxpool2D as its last layer. Is Maxpool2D as the target layer not possible or it is just not implemented?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kundajelab/deeplift/issues/82?email_source=notifications&email_token=AARSFBRHIPHIZENIJLOWZR3PZDG5RA5CNFSM4HU64YW2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GX6442Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AARSFBTEGV6DCVQUBBAMFLTPZDG5RANCNFSM4HU64YWQ .

-- Sent from my phone, please excuse brevity/typos

MuskaanJain commented 5 years ago

with some combination of output neurons.

AvantiShri commented 5 years ago

Nice running into you at ISMB yesterday! To recap, all the backpropagation-based interpretation methods rely on a single output at which to start the backprop. My recommendation is that for interpretation, you could add a fully-connected neuron that encodes the combination of maxpooling neurons you are interested in, and then do interpretation with respect to that fully-connected neuron. If you run into issues of particular architectures not being supported, you could also use DeepSHAP (a combination of DeepLIFT + the SHAP method): https://github.com/kundajelab/deeplift#my-model-architecture-is-not-supported-by-this-deeplift-implementation-what-should-i-do