NLP, Interpretability, Machine Learning, Pytorch, Captum.
torch.tensor([tokens_idx], dtype=torch.long) ref = torch.tensor(...) x = x.to(device) ref = ref.to(device) base_class = 2 lig = LayerIntegratedGradients( model, model.embeddings.embedding, ) attributions_ig, delta = lig.attribute( x, ref, n_steps=500, return_convergence_delta=True,