pytorch / captum

Model interpretability and understanding for PyTorch
https://captum.ai
BSD 3-Clause "New" or "Revised" License
4.92k stars 497 forks source link

Intergrated Gradients #463

Closed MarxAC closed 4 years ago

MarxAC commented 4 years ago

Hi, I found a recommendation for Captum and started trying it out, it worked great on basic models, but when I run it on one of my larger deep feedforward sequential models I get the error below. I have preformed various sensitivity analyses (that use matmul) on the model (NETWORK) with the input (X_test) so the error doesn't make sense to me. Any suggestions would be appreciated.

ig = IntegratedGradients(NETWORK) ig_attr = ig.attribute(X_test, target=0)

Error: torch\nn\functional.py", line 1676, in linear output = input.matmul(weight.t()) RuntimeError: mat1 dim 1 must match mat2 dim 0

NarineK commented 4 years ago

Thank you for the question, @MarxAC ! Are you able to call : NETWORK(X_test) ? what is the shape of output: NETWORK(X_test) ?

NarineK commented 4 years ago

@MarxAC, do you have any outstanding questions right now ? If not, can we, please, close this issue ?

MarxAC commented 4 years ago
Thank you for the feedback and check-up. Yes please close the issue. Unfortunately I haven’t had the time to work on that problem in the last two weeks. Thank you for your time and effort. Kind RegardsAlton Marx From: NarineKSent: Friday, 25 September 2020 1:45 AMTo: pytorch/captumCc: MarxAC; MentionSubject: Re: [pytorch/captum] Intergrated Gradients (#463) @MarxAC, do you have any outstanding questions right now ? If not, can we, please, close this issue ?—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.