Comments (10)
Hi @KeLanhhh,
Thanks for reaching out. Is it not possible to achieve global maxpooling by specifying a pooling width that covers your entire input?
To make DeepLIFT support your customized layer, you would need to define a DeepLIFT layer object that corresponds to your layer, and then define a conversion function. I can explain how to do these things, but it may be better to wait until after a DeepLIFT update I am planning to put out in the next week or so (the update will be accompanied by a new ArXiv preprint). Would it be possible to wait that long? If not, let me know and I can guide you on how to achieve your desired layer in the current implementation (assuming that a pooling layer with a sufficiently large pooling width does not satisfy your use-case)
from deeplift.
Thank you for the quick reply! @AvantiShri, a week or longer would be okay for me, just do you work first. By the way, my input length is not too long, So selecting top k max features might perform better than usual local max pooling.
ps: looking forward to your big update!
from deeplift.
Does DeepLIFT support to use deep residual? I have a model with deep residual, and want to use DeepLIFT to interpret it too. Thanks!
from deeplift.
Hi @ttgump - not yet, but it would not be hard to add. Can you tell me more about the layer types you use to implement the resnet (are you using Keras?)
from deeplift.
@AvantiShri Yes, I am using Keras.
from deeplift.
@ttgump Great, if I understand correctly you are probably using a merge layer with "sum" as the merge mode. Currently I have support for the "concat" merge mode but I can add "sum". Just to be on the safe side, can you let me know any other layer types you might be using?
from deeplift.
Hi, @AvantiShri
I read your new preprint of DeepLift, nice job! I think the separated positive and negative contribution might be very useful to my work.
Like what we discussed before, I want to apply DeepLift to my model which contains a customized k max pooling layer. At your convenience, could you teach me how to achieve my desired layer in the current DeepLift implementation? If need, I can also post the code of my layer here.
Thank you :)
from deeplift.
@KeLanhhh Glad you liked the paper! Yes, it would be helpful if you tell me about the implementation of your layer here, and then I can advise you on how to adapt it for DeepLIFT.
from deeplift.
@AvantiShri Here is code of k max pooling layer used in my model.
from keras import backend as K
from keras.engine.topology import Layer
class KMaxPooling(Layer):
def __init__(self, K, **kwargs):
super(KMaxPooling, self).__init__(**kwargs)
self.K = K
def get_output_shape_for(self,input_shape):
shape = list(input_shape)
shape[1] = self.K
return tuple(shape)
def call(self,x,mask = None):
k = theano.tensor.cast(self.K, dtype="int32")
sorted = theano.tensor.sort(x, axis = 1)
out = sorted[:, -k:, :]
return out
def get_config(self):
config = {"pool_size": self.K}
base_config = super(KMaxPooling, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
Is it hard to convert? Please let me know if you need any further information!
Thanks!
from deeplift.
Hi there,
I also have a customized layer implemented in Keras (code is here). It may be slightly more complicated than @KeLanhhh 's case though as it is a trainable layer. Could you help in supporting this in DeepLift ?
Thanks a lot in advance,
Best
Nicolas
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.