Open iamawhalez opened 2 years ago
Hi @iamawhalez, it is trying to ignore the loss on padding tokens in static code, so that's why it is ignoring padding. byte_fields won't participate in this loss computation. But your understanding is right, here is to calculate the loss for static field.
https://github.com/CUMLSec/trex/blob/7b2cabaecdaeb043da48d85a9016fed391ea75a5/fairseq/criterions/trex.py#L84
i think the code here is to calculate the loss of static_field(code), so the ignore_index should be byte_fields. Am i right?