Skip to content

Commit

Permalink
ENH: Log training time in core.train, fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
NickleDave committed Feb 24, 2023
1 parent 9c814de commit f4676c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/vak/core/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import pathlib
import shutil
import datetime

import joblib

Expand Down Expand Up @@ -361,8 +362,20 @@ def train(
default_callback_kwargs=default_callback_kwargs,
device=device,
)
train_time_start = datetime.datetime.now()
logger.info(
f"Training start time: {train_time_start.isoformat()}"
)
trainer.fit(
model=model,
train_dataloaders=train_loader,
val_dataloaders=val_loader,
)
train_time_stop = datetime.datetime.now()
logger.info(
f"Training stop time: {train_time_stop.isoformat()}"
)
elapsed = train_time_stop - train_time_start
logger.info(
f"Elapsed training time: {elapsed}"
)

0 comments on commit f4676c3

Please sign in to comment.