Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
Add assertion of scheduler periods and epochs
  • Loading branch information
byeonghu-na committed Dec 9, 2022
1 parent 57b6b8e commit 12fd00a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def _set_random_seed(seed):
def _get_training_phases(config, n):
lr = np.array(config.optimizer_lr)
periods = config.optimizer_scheduler_periods
assert sum(periods) == config.training_epochs
sigma = [config.optimizer_scheduler_gamma ** i for i in range(len(periods))]
phases = [TrainingPhase(n * periods[i]).schedule_hp('lr', lr * sigma[i])
for i in range(len(periods))]
Expand Down

0 comments on commit 12fd00a

Please sign in to comment.