Comments (2)
Hi younglululu,
I had to refresh my memory, but the answer is yes! find_scores_layer_idx (for a sequential model) and find_scores_layer_name (for a graph model) can actually be lists:
https://github.com/kundajelab/deeplift/blob/master/deeplift/models.py#L225-L227
https://github.com/kundajelab/deeplift/blob/master/deeplift/models.py#L278-L280
I would have changed the names of the arguments to reflect this, but I didn't want to break the API. Let me know if you have any issues.
from deeplift.
Oh, one more followup remark: for all layers except the input layer, multipliers are split up into pos_mxts and neg_mxts (as needed by the RevealCancel rule described in the DeepLIFT paper). For layers that act as inputs to nonlinearities, these will be different, but for layers that act as inputs to a linear layer, these should be the same. Because get_mxts()
is not defined for anything other than Input layers (instead, there is get_pos_mxts()
and get_neg_mxts()
), you could modify the following line https://github.com/kundajelab/deeplift/blob/master/deeplift/models.py#L56 to use the average of get_pos_mxts()
and get_neg_mxts()
if get_mxts()
is not defined for the layer. The code would look something like this:
output_symbolic_vars = [
(find_scores_layer.get_mxts() if hasattr(find_scores_layer, 'get_mxts())
else 0.5*(find_scores_layer.get_pos_mxts() + find_scores_layer.get_neg_mxts()))
for find_scores_layer in find_scores_layers]
Let me know if that works for your purposes, and if it does, would be happy to accept a pull request to the main code base!
from deeplift.
Related Issues (20)
- reference provided but
- categorial variables HOT 2
- adjustment for softmax HOT 2
- KeyError: 'batch_input_shape' while using deeplift on keras
- KeyError: 'zeropadding2d' HOT 1
- Question regarding version 0.6.11.0 that is not anymore available. HOT 2
- bpnet/deepexplain issue
- genomics training example HOT 1
- DeepLIFT with the RevealCancel rule
- Deeplift with Cifar10 HOT 3
- how do I download deeplift version of 0.5.1-theano HOT 2
- How to use deeplift for regression HOT 1
- Does DeepLIFT support to use deep residual? I have a model with deep residual, and want to use DeepLIFT to interpret it too. Thanks! HOT 1
- can deeplift explain text classification? HOT 2
- Sequential model input layer convert HOT 3
- Aggregating contribution scores
- keras2_mnist_cnn_allconv.h5 of MNIST demo can't be decoded
- Dimension error in a multi-input, multi-channel CNN HOT 2
- AttributeError: module 'tensorflow' has no attribute 'placeholder'
- deepLIFT scores always central to genomic sequence
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 deeplift.