Hi,
The test
method of the Trainer
class, has the input argument ckpt_path
. According to the docs:
ckpt_path (Optional[str]) – Either best or path to the checkpoint you wish to test. If None and the model instance was passed, use the current weights. Otherwise, the best model from the previous trainer.fit call will be loaded.
Also, in the Documentation of PyTorch Lightning for the test set, using Trainer, there is the following:
# run full training
trainer.fit(model)
# (1) load the best checkpoint automatically (lightning tracks this for you)
trainer.test(ckpt_path="best")
My question is, according to what the “best” checkpoint is decided? That is, is the “best” decided on maximising or minimising some value? What would be that value? Can someone configure the policy (i.e. minimising or maximising) and the value? How one should use this “best” string?
Links for reference:
P.S. Please note that I’m not referring to using the ModelChekpoint
callback, but explicitly to the above