Skip to content

Commit

Permalink
Fixed loss (we were saving model with best 'loss' rather than best 't…
Browse files Browse the repository at this point in the history
…otal_loss')
  • Loading branch information
joelnmdyer committed Sep 17, 2024
1 parent b31d0b0 commit 4800a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blackbirds/infer/vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ def run(
"Loss/regularisation", regularisation_loss, epoch
)
torch.save(self.best_estimator_state_dict, "last_estimator.pt")
if loss < self.best_loss:
self.best_loss = loss
if total_loss < self.best_loss:
self.best_loss = total_loss
self.best_estimator_state_dict = deepcopy(
self.posterior_estimator.state_dict()
)
Expand Down

0 comments on commit 4800a31

Please sign in to comment.