ERNIE-Layout-Pytorch icon indicating copy to clipboard operation
ERNIE-Layout-Pytorch copied to clipboard

Outputs are driven to zero when there's a strong imbalance

Open DiddyC opened this issue 4 months ago • 1 comments

Hi,

I recently upgraded to PyTorch 2.x, using the latest code from the repository. While training a Named Entity Recognition (NER) classification model, I've noticed that when the majority of the tokens belong to a single class (e.g., class 0), the model converges and predicts only that majority class. This happens regardless of the batch size or learning rate I select.

Interestingly, this issue did not occur when using PyTorch 1.8. Has anyone else encountered this problem? Any insights or solutions would be greatly appreciated!

Thanks in advance for your help!

DiddyC avatar Oct 04 '24 20:10 DiddyC