Skip to content

Add a util function for training loop#34

Open
SarahAlidoost wants to merge 6 commits intomainfrom
fix_33
Open

Add a util function for training loop#34
SarahAlidoost wants to merge 6 commits intomainfrom
fix_33

Conversation

@SarahAlidoost
Copy link
Copy Markdown
Member

@SarahAlidoost SarahAlidoost commented Mar 18, 2026

closes #33

relates #13 using torch.utils.tensorboard

@SarahAlidoost SarahAlidoost changed the title Fix 33 Add a util function for training loop Mar 18, 2026
@SarahAlidoost
Copy link
Copy Markdown
Member Author

SarahAlidoost commented Mar 18, 2026

@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.

@SarahAlidoost SarahAlidoost marked this pull request as ready for review April 1, 2026 15:52
@SarahAlidoost SarahAlidoost requested a review from rogerkuou April 1, 2026 15:52
@SarahAlidoost SarahAlidoost mentioned this pull request Apr 3, 2026
Copy link
Copy Markdown
Collaborator

@rogerkuou rogerkuou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if it is a common pratice to output the best model to the log dir? If yes let's keep it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a util function for training loop

2 participants