54yyyu / evoaug-tf

Evolution-inspired data augmentations for TensorFlow-based models for regulatory genomics
https://evoaug-tf.readthedocs.io/
MIT License
1 stars 1 forks source link

how to proceed with deepExplainer ? #5

Open hopdebee opened 7 months ago

hopdebee commented 7 months ago

Hi,

Thanks for adapting this to the TF library, still very popular in the regulatory genomics DL field :).

I'm using deepExplainer to interpret my original model. The paper mentions that you guys evaluated the interpretation with deepShap, among other methods. Wrapped in the RobustModel Class, I'm a bit at a loss how to generate shap values for sequences. I figured out that the original model can be found with Robustmodel.model, but could it be that the input shape of that "model" has changed, so that it is not compatible anymore with the original training sequences ? Should i now pad my original sequences ? What's the effect on the interpretation ?

Thanks for pointing me in the right direction !

p-koo commented 7 months ago

Yes, you need to pad the original sequence with zeros to match the shape of the max insertion. For deepExplainer, you need to use RobustModel.model <-- this gives access to the keras model, which is what deepExplainer can operate on. Hope this helps!

hopdebee commented 7 months ago

For people who also want to do this: Note that a padding of 20 consists of 10 random nucleotides at the start and 10 at the end of the sequence, not 20 at one end !