Hi, I want to print the best score at the end of training.
ModelCheckpoint handler can save the best model with the best score,
however, I just want to print the best score at the end of training.
Is it possible to save the best score till the end of training?
@Soo95 there is nothing done for this today. I would say this can be done manually when run evaluators.
@trainer.on(Events.STARTED)
def init_best_score(engine):
engine.state.best_score = 0.0
@trainer.on(Events.EPOCH_COMPLETED)
def run_evaluation(engine):
res = evaluator.run(val_loader)
trainer.state.best_score = max(trainer.state.best_score, res['your_metric'])
res = trainer.run(train_loader, 10)
print("Best score is : ", res.best_score)
HTH
@vfdev-5
I always thank for your kind replies!
Most helpful comment
@Soo95 there is nothing done for this today. I would say this can be done manually when run evaluators.
HTH