Learning Rate Steps
A training run uses torch.optim.lr_scheduler.StepLR: the learning rate starts at lr and is multiplied by gamma after every step_size epochs. Return the learning rate that each of the first epochs epochs trains with.
Example 1
lr 0.1
step_size 2
gamma 0.5
epochs 5
returns [0.1,0.1,0.05,0.05,0.025]
Constraints
1 <= step_size <= 41 <= epochs <= 12
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- Logistic RegressionHard
- Skip the PaddingHard
- Slide a KernelHard
- The Second DerivativeHard
- Windows and TargetsHard
- A Table of ZerosBeginner
- Add Them UpBeginner
- Biggest and WhereBeginner