Skip to content

Commit

Permalink
fix off by one error (see #2289) epoch starts at 0 now
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Jun 22, 2020
1 parent 1a39e1d commit c5330ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/callbacks/test_early_stopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def on_train_end(self, trainer, pl_module):


@pytest.mark.parametrize('loss_values, patience, expected_stop_epoch', [
([6, 5, 5, 5, 5, 5], 3, 5),
([6, 5, 4, 4, 3, 3], 1, 4),
([6, 5, 6, 5, 5, 5], 3, 5),
([6, 5, 5, 5, 5, 5], 3, 4),
([6, 5, 4, 4, 3, 3], 1, 3),
([6, 5, 6, 5, 5, 5], 3, 4),
])
def test_early_stopping_patience(loss_values, patience, expected_stop_epoch):
"""Test to ensure that early stopping is not triggered before patience is exhausted."""
Expand Down

0 comments on commit c5330ed

Please sign in to comment.