Comments (4)
Hi Christopher,
You’re fine, the issue is with deeplift.
(1) get_name_to_blob is indeed deprecated to get_name_to_layer. Where did you encounter get_name_to_blob? I thought I had updated the README, evidently i missed something somewhere.
(2) Some context about the second error you are getting: traditionally, people use sigmoid or softmax outputs when doing classification, and linear outputs when doing regression. In the case of the former, DeepLIFT computes the contribution wrt the linear activation preceeding the final nonlinearity to avoid the saturation effects of the sigmoid/softmax. In the case of a linear output, DeepLIFT computes contributions wrt to the provided linear layer. You are trying to compute contributions to a linear layer that is followed by a ReLU nonlinearity. I can add this case in (would need to clarify how you want to handle ReLU saturation), but I also note that you are evidently computing contributions to neurons in the first convolutional layer. Is that actually the layer you are interested in? And do you care about interpeting individual neurons in the conv layer, or the activation of the entire layer as a whole? If you care about interpreting every individual neuron in the conv layer, you might find it easier to compute the contributions using a series of numpy matrix multiplications (which is tractable to implement for just a single layer; I can describe how to do this if that is in fact what you are after). DeepLIFT is currently set up to compute contributions to one target output neuron at a time, so it would be cumbersome to perform DeepLIFT for every individual neuron in the conv layer.
from deeplift.
Hi Avanti,
Thanks for the quick response. I think I came across get_name_to_blob scrolling through the issues thread.
- You're right, the code I pasted was wrong (I'd been playing around with it a little), and I do not really want the contribution to layers in the first convolutional layer. I think the correct call would be:
revealcancel_func = deeplift_model.get_target_contribs_func(find_scores_layer_name="input_1_0", pre_activation_target_layer_name="preact_dense_3_0")
This seems to throw a different error:
File "", line 1, in
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/models.py", line 113, in get_target_contribs_func
return self._get_func(*args, func_type=FuncType.contribs, **kwargs)
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/models.py", line 269, in _get_func
**kwargs)
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/models.py", line 49, in _get_func
find_scores_layer.update_mxts()
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/core.py", line 183, in update_mxts
output_layer.update_mxts()
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/core.py", line 183, in update_mxts
output_layer.update_mxts()
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/core.py", line 184, in update_mxts
output_layer._update_mxts_for_inputs()
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/core.py", line 346, in _update_mxts_for_inputs
neg_mxts_increments) = self._get_mxts_increments_for_inputs()
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/pooling.py", line 89, in _get_mxts_increments_for_inputs
pos_mxts_increments = self._grad_op(self.get_pos_mxts())
File "/Users/christopher_penfold/Desktop/Code/deeplift/deeplift/layers/pooling.py", line 79, in _grad_op
return tf.squeeze(nn_grad.gen_nn_ops.max_pool_grad(
AttributeError: module 'tensorflow.python.ops.gen_nn_ops' has no attribute 'max_pool_grad'
For my setup I'm doing classification (potentially multi class multi output classification) I was using the RelU layers just based on some code I had. Should be easy enough to switch to sigmoid or softmax if these would be more appropriate and don't expect the accuracy to be
from deeplift.
Yes, I think sigmoid/softmax outputs are def more appropriate for classification if trained with binary/categorical crossentropy losses.
I think the error you got is caused by using an old version of tensorflow. Can you upgrade to tensorflow version 1.7 or later?
from deeplift.
Ah! Of course facepalm 😳Seems to work now, will continue going through, but I think we can call this issue closed
from deeplift.
Related Issues (20)
- 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
- Dinucleotide shuffling does not shuffle
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.