roatienza / deep-text-recognition-benchmark

PyTorch code of my ICDAR 2021 paper Vision Transformer for Fast and Efficient Scene Text Recognition (ViTSTR)
Apache License 2.0
284 stars 57 forks source link

A question about [GO[ token #19

Closed zhaiyukun closed 2 years ago

zhaiyukun commented 2 years ago

criterion = torch.nn.CrossEntropyLoss(ignore_index=0).to(device) # ignore [GO] token = ignore index 0

why you ignore GO token when setup loss?

Thank you

roatienza commented 2 years ago

GO does not have any contribution to the correctness of the prediction. This technique is used in most Attention-based models. The model converges faster with ignore index = 0.

zhaiyukun commented 2 years ago

thank you for you reply!