pschwllr/MolecularTransformer

Extraction of Attention Weights

Closed this issue · 1 comments

Hello,

Great tool! I would like to know the best way to store attention weights (for later visualization) for each SMILES string during evaluation. Is there a means to extract this information?

best,
Dean

Hi Dean,

Sorry for the late reply. The best way to store the attention is to output it similar to all_predictions and all_scores in the translator.py.

-> https://github.com/pschwllr/MolecularTransformer/blob/master/onmt/translate/translator.py#L232

I hope this helps.

Best,

Philippe