Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mart/configs/lightning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ tags: ["dev"]
# Train it or not.
fit: True

# check performance on test set, using the best model achieved during training
# check performance on validation and test set, using the best model achieved during training
# lightning chooses best model based on metric specified in checkpoint callback
validate: False
test: True

# Whether to resume training using configuration and checkpoint in specified directory
Expand Down
5 changes: 5 additions & 0 deletions mart/tasks/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def lightning(cfg: DictConfig) -> Tuple[Dict[str, Any], Dict[str, Any]]:

train_metrics = trainer.callback_metrics

# Evaluate model on validation set, using the best model achieved during training
if cfg.get("validate"):
log.info("Starting validation!")
trainer.validate(model=model, datamodule=datamodule, ckpt_path=ckpt_path)

# Evaluate model on test set, using the best model achieved during training
if cfg.get("test"):
log.info("Starting testing!")
Expand Down