question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multimodal input binary classifier with Saliency

See original GitHub issue

❓ Questions and Help

Hi Everyone,

Question:

How can I apply saliency to a dataset composed of categorical and image data?

I am somewhat of a beginner with pytorch and the available resources are just not clicking with my use case. The ultimate goal is for me to plot the saliency of a model, but I am stuck on calculating the gradient. Any help or guidance would be much appreciated.

What I’ve reviewed:

Multimodal_VQA_Captum_Insights tutorial BERT tutorials (These resources all have very different data structures(images/sentences) and are confusing for a beginner to translate to an easier image/categorical dataset)

My issue

Model

Model(
  (label_embedding): Embedding(10, 10)
  (model): Sequential(
    (0): Linear(in_features=1034, out_features=512, bias=True)
    (1): LeakyReLU(negative_slope=0.2, inplace=True)
    (2): Linear(in_features=512, out_features=512, bias=True)
    (3): Dropout(p=0.4, inplace=False)
    (4): LeakyReLU(negative_slope=0.2, inplace=True)
    (5): Linear(in_features=512, out_features=512, bias=True)
    (6): Dropout(p=0.4, inplace=False)
    (7): LeakyReLU(negative_slope=0.2, inplace=True)
    (8): Linear(in_features=512, out_features=1, bias=True)
  )
)

Categorical

The categorical data is just a normal label such as 4

What I tried

saliency = Saliency(model)
grads = saliency.attribute((input, label), target=None)

where input is just a (1, 32, 32) image. I set target=None since it’s a binary classifier.

Failure output

One of the differentiated Tensors does not require grad

Since the label is not a float it does not require grad, is there a way i can use the saliency method to capture the grads?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
nanohannocommented, Jul 23, 2021

Thanks for the good suggestion, @nanohanno!

Do you want to create a PR for this? I can gladly help getting this landed. I can also update the message myself if needed.

I am happy to create a PR for it.

1reaction
bilalsalcommented, Jul 23, 2021

Thanks for the good suggestion, @nanohanno!

Do you want to create a PR for this? I can gladly help getting this landed. I can also update the message myself if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deep Multimodal Fusion Autoencoder for Saliency Prediction ...
In this study, we propose a novel deep multimodal fusion autoencoder for the saliency prediction of RGB-D images.
Read more >
MSD: Saliency-aware Knowledge Distillation for Multimodal ...
The task is a binary classification. Page 4. 3560 problem, which is to detect hate speech in multi- modal memes. We use Accuracy...
Read more >
Application of Multimodal Fusion Technology in Image ... - NCBI
Multimodal medical image fusion technology can obtain richer lesion ... Support vector machine (SVM) is a linear binary classification ...
Read more >
A generalizable saliency map-based interpretation of model ...
Experiments show that our inter- pretability method can reconstruct the salient part of the input with a classification accuracy of 89%. Index ...
Read more >
Multimodal Saliency and Fusion for Movie Summarization ...
The multimodal saliency representation forms the basis of a generic, bottom-up video summarization algorithm. Different fusion schemes are evaluated on a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found