Skip to content

Commit

Permalink
Hopefully clarify comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo committed Jan 8, 2025
1 parent 4f89b6c commit d740ff9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions skorch/tests/callbacks/test_lr_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ def test_simulate_lrs_reduced_lr_on_plateau_scalar(self):
# O = OK epoch
# I = intertolerable epoch
#
# 1 2 3 4 5 epoch number
# O I I I I epoch classification
# 0 1 2 3 4 number of bad epochs
# * * * epochs with LR reduction
# 0 1 2 1 2 number of bad epochs
# * * epochs with LR reduction
#
# note that simulate returns the LRs before the step, not after,
# so we're seeing only 4 updated values.
assert all(lrs == [1] + [1, 1, 0.1, 0.1])
# note that simulate returns the lrs before the step, not after,
# so we're seeing only 4 new simulated values.
assert all(lrs == [1, 1, 1, 0.1, 0.1])

def test_simulate_lrs_reduced_lr_on_plateau_array(self):
lr_sch = LRScheduler(
Expand All @@ -65,9 +66,13 @@ def test_simulate_lrs_reduced_lr_on_plateau_array(self):
# O = OK epoch
# I = intertolerable epoch
#
# 1 2 3 4 5 epoch number
# O O I I O epoch classification
# 0 0 1 2 0 number of bad epochs
# * epochs with LR reduction
#
# note that simulate returns the LRs before the step, not after,
# so we're seeing only 4 new simulated values.
assert all(lrs == [1, 1, 1, 1, 0.1])

@pytest.mark.parametrize('policy, instance, kwargs', [
Expand Down

0 comments on commit d740ff9

Please sign in to comment.