Comments (2)
Came up with a way to at least make the attribute function work for GuidedBackprop (and would work for Input x Gradient as well):
https://github.com/nfelnlp/thermostat/blob/a8d74650f8ba4f4b0f6504cf8c06043e492d6ed3/src/thermostat/explainers/grad.py#L115
However, this meant:
- creating a new model and explainer from scratch (due to the way forward functions are handled)
- wrapping the model with a different forward function - following https://github.com/copenlu/ALPS_2021/blob/2d1a500be8affaf874da688ebcbb544f66ecb5e4/tutorial_src/model_builders.py#L162
- shoving the inputs through the model's embeddings layer using the
inputs_embeds
parameter instead of theinput_ids
parameter
This results in an attributions
shape of (1, 512, 768) which probably doesn't make sense at all.
from thermostat.
After consulting with @rbtsbg, InputXGradient and GuidedBackprop will be substituted by LayerGradientXActivation
which works similar to LayerIntegratedGradients
and is easier to handle with just passing the base model's embedding layer to the explainer at creation time.
from thermostat.
Related Issues (13)
- Selection of experiment_in unsafe HOT 1
- MNLI and XNLI downstream model performance very low HOT 1
- Missing assertion that num_labels in dataset corresponds to classification head shape of model
- Improve heatmap visualization options (more color schemes, better readability)
- Prediction Values in Dataset HOT 3
- ExplainerCaptum.get_inputs_and_additional_args and .get_forward_function need to be extensible HOT 1
- LIME : "normal_kernel_cuda" not implemented for 'Long' HOT 4
- [KernelShap] ZeroDivisionError: Weights sum to zero, can't be normalized HOT 1
- Find out if the cast to long for batch components in forward functions is necessary HOT 1
- batch dimension ignored HOT 4
- AttributeError: 'XLNetModel' object has no attribute 'embeddings' HOT 6
- LIME token similarity kernel for input.shape[0] > 1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thermostat.