control mlflow logging

This commit is contained in:
shahules786 2022-10-06 16:11:50 +05:30
parent 4fcecdd22f
commit 2683940ff4
1 changed files with 10 additions and 2 deletions

View File

@ -120,7 +120,11 @@ class Model(pl.LightningModule):
loss = self.loss(prediction, target)
if self.logger:
if (
(self.logger)
and (self.global_step > 50)
and (self.global_step % 50 == 0)
):
self.logger.experiment.log_metric(
run_id=self.logger.run_id,
key="train_loss",
@ -141,7 +145,11 @@ class Model(pl.LightningModule):
self.log("val_metric", metric_val.item())
self.log("val_loss", loss_val.item())
if self.logger:
if (
(self.logger)
and (self.global_step > 50)
and (self.global_step % 50 == 0)
):
self.logger.experiment.log_metric(
run_id=self.logger.run_id,
key="val_loss",