-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging additional metrics #448
Conversation
Coverage reportNote Coverage evolution disabled because this PR targets a different branch The coverage rate is
Diff Coverage details (click to unfold)src/renate/updaters/model_updater.py
src/renate/utils/misc.py
|
self._log(trainer=trainer, training=pl_module.training) | ||
self._log(trainer=trainer, pl_module=pl_module) | ||
|
||
def on_train_start(self, trainer: Trainer, pl_module: LightningModule) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this called also for sanity_checking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on_train_start()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It runs on on_validation_start, hence the special handling checking for None in the Additional metrics class.
src/renate/utils/misc.py
Outdated
|
||
def __call__(self, model: torch.nn.Module) -> Dict[str, Union[float, int]]: | ||
if self._training_times: | ||
epoch_training_time = self._training_times[-1] - self._training_times[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this the epoch_training_time? isn't this total training time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying.
src/renate/utils/misc.py
Outdated
def on_train_start(self) -> None: | ||
self._training_times.append(time.time()) | ||
|
||
def on_train_epoch_end(self) -> None: | ||
self._training_times.append(time.time()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using a list, maybe simply save start and end time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to keep the flexibility of retrieving all times, though the current interface doesn't
necessarily allow for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless we use it or plan to use it soon, we shouldn't sacrifice simplicity for flexibility. unless you strongly disagree, let's keep this simple.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.