Skip to content

Commit

Permalink
refactor: logging embeddings for both training and validation steps i…
Browse files Browse the repository at this point in the history
…n multitas
  • Loading branch information
laserkelvin committed Jul 1, 2024
1 parent 43175b4 commit d53cde4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions matsciml/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3051,6 +3051,9 @@ def training_step(
prog_bar=True,
batch_size=batch_info["batch_size"],
)
# optionally log embeddings
if self.hparams.log_embeddings and "embeddings" in batch:
self._log_embedding(batch["embeddings"])
return losses

def validation_step(
Expand Down Expand Up @@ -3105,6 +3108,9 @@ def validation_step(
prog_bar=True,
batch_size=batch_info["batch_size"],
)
# optionally log embeddings
if self.hparams.log_embeddings and "embeddings" in batch:
self._log_embedding(batch["embeddings"])
return losses

@classmethod
Expand Down

0 comments on commit d53cde4

Please sign in to comment.