2
$\begingroup$

I have a sequence to sequence classification model with two classes (similar to NER transformer) and because my data samples have different lengths I use padding. Is it better to use a custom loss function (with a masking layer/attention mask) that ignores padding, or use an extra class for padding and classify padding as well? Or it doesn't make any difference in terms of model quality?

$\endgroup$
1

1 Answer 1

1
$\begingroup$

You should ignore padding. Predicting padding only adds a useless burden to the model.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.