Skip to content

Commit

Permalink
Update test_optimizer_config.py (#814)
Browse files Browse the repository at this point in the history
Add simple tests for rewarmup schedule
  • Loading branch information
blahBlahhhJ authored Nov 20, 2024
1 parent ccec7f5 commit 80b2296
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_optimizer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def test_rewarmup_schedule():
assert np.isclose(sched_fn(100), 1e-2) # Warmup reaches max LR

# First decay phase
assert np.isclose(sched_fn(300), 0.6e-2) # Mid of first decay
assert np.isclose(sched_fn(500), 0.2e-2) # End of first decay

# Rewarmup at start of second cycle
Expand All @@ -184,4 +185,5 @@ def test_rewarmup_schedule():
assert sched_fn(rewarmup_end + 1) < sched_fn(rewarmup_end)

# Final decay phase
assert sched_fn(999 - 1) > sched_fn(999)
assert np.isclose(sched_fn(999), 0.2e-2, atol=1e-4) # End of second decay

0 comments on commit 80b2296

Please sign in to comment.