transformers.Trainerのカスタマイズ
To inject custom behavior you can subclass them and override the following methods:
compute_lossメソッドをオーバーライドする例
Another way to customize the training loop behavior for the PyTorch Trainer is to use callbacks that can inspect the training loop state (...) and take decisions (like early stopping).