Skip to content

Commit

Permalink
Check for NaNs in loss
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersson committed Jul 17, 2023
1 parent 190abf4 commit 40d994a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ def test_training(self):
for epoch in tqdm(range(n_epochs)):
batch_losses = train_epoch(model, train_tasks, batch_size=batch_size)
epoch_losses.append(np.mean(batch_losses))

# Check for NaNs in the loss
loss = np.mean(epoch_losses)
self.assertFalse(np.isnan(loss))

0 comments on commit 40d994a

Please sign in to comment.