PAIR-code / lit

The Learning Interpretability Tool: Interactively analyze ML models to understand their behavior in an extensible and framework agnostic interface.
https://pair-code.github.io/lit
Apache License 2.0
3.46k stars 352 forks source link

How to Show the Attentions #164

Open Palipoor opened 3 years ago

Palipoor commented 3 years ago

Hi, I run a code like the example in lit_nlp/examples/sst_pytorch_demo.py.py for a costum model and dataset and It doesn't show the Attentions box in the explanations part. What should I do to see them? I return the attentions in predict_minibatch but not the grads.

jameswex commented 3 years ago

If your model's output spec includes type AttentionHeads and you return that information in predict_minibatch, and your UI layout includes the attention visualization (the default one does), then the Attentions module should be shown in the UI.

Are you able to share the code for your LIT server with your model/dataset?

pratikchhapolika commented 2 years ago

Hi, I run a code like the example in lit_nlp/examples/sst_pytorch_demo.py.py for a costum model and dataset and It doesn't show the Attentions box in the explanations part. What should I do to see them? I return the attentions in predict_minibatch but not the grads.

please psot the code?