Add a util function for training loop#34
Conversation
|
@rogerkuou I am implementing the training loop as a util function in this PR, also saving model and its config. I have to change the example notebook, but lets see how much we can change in other PR #27 and merge that one first. |
rogerkuou
left a comment
There was a problem hiding this comment.
Hi @SarahAlidoost, thanks for making this util function! I managed to run the example notebook on my local.
I just have one minor comment on saving the best model to the log dir. Please feel free to adapt it or not.
After merging I will start to use this util function in PR #27
climanet/utils.py
Outdated
|
|
||
| def _save_model(model: torch.nn.Module, log_dir: str, verbose: bool) -> None: | ||
| """Save model state and config to disk.""" | ||
| model_path = Path(log_dir) / "best_model.pth" |
There was a problem hiding this comment.
I am wondering if it is a common pratice to output the best model to the log dir? If yes let's keep it!
There was a problem hiding this comment.
Typically they store everything in one run directory. So, it is better to rename log_dir to run_dir.
thanks for reviewing. While I was working on #32, I found that it is better to have a |
closes #33
relates #13 using
torch.utils.tensorboard