microsoft / CodeBERT

CodeBERT
MIT License
2.23k stars 454 forks source link

Seq2Seq CodeBERT - ignore index = -1 #145

Closed MichaelFu1998-create closed 2 years ago

MichaelFu1998-create commented 2 years ago

Dear CodeBERT authors, Thanks for your amazing work! Given the pad token id of CodeBERT tokenizer is "1" I'm wondering why the ignore_index param in the CrossEntropyLoss is set to "-1" in the following code https://github.com/microsoft/CodeBERT/blob/567dd49a4b916835f93fb95709de714b8772fea2/CodeBERT/code2nl/model.py#L68

Kind regards Michael