I have an unbalanced dataset. When training I want to pass class_weights so the update for rare classes is highen than for large classes. How is this possible in HF with PyTorch?
Thanks
Philip
I have an unbalanced dataset. When training I want to pass class_weights so the update for rare classes is highen than for large classes. How is this possible in HF with PyTorch?
Thanks
Philip
Answering my own question:
Subclass Trainer
and override the compute_loss
method (see example here).
Sorry I missed your question and didn’t point you to this directly.
No worries. You did on GitHub…
Hi @PhilipMay !Do you mind pasting an example please, as I don’t really understand the documentation