Captum, Integrated gradients and Deep Metric Learning

Hi everyone,

I started looking into the Captum tutorial, and I realize that the Integrated Gradients need a label for the computation.

Here is my problem: I use a Deep Metric Learning model, which means that I don’t have a classification layer but an AveragePooling (or MaxPooling) layer at the end that gives me a feature vector of length n.

Then the “classification” is simply the cosine similarity between the test embedding and a set of reference embeddings.

My question is: can captum’s IG be used in a scenario like this ?

Thanks