Praneet9 / Representation-Learning-for-Information-Extraction

Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Apache License 2.0
102 stars 29 forks source link

Provide loss function (FocalLoss) #38

Open hienpham15 opened 1 year ago

hienpham15 commented 1 year ago

I have noticed that in train.py and eval.py you have import a FocalLoss class which is then used as criterion for both training and evaluating.

But I couldn't find relevant definition of this loss function in both the paper and the source code.

Would you mind sharing the FocalLoss class definition ?

Praneet9 commented 11 months ago

@hienpham15 The paper doesn't use FocalLoss, it was something we did as an addition to the model training due to the skewed dataset we trained on. It was easier to use a prebuilt library for focal loss instead of writing our own. You can feel free to use any loss function for your convenience.