PolynomialLR¶
- class torch.optim.lr_scheduler.PolynomialLR(optimizer, total_iters=5, power=1.0, last_epoch=-1)[source][source]¶
在給定的 total_iters 內,使用多項式函式衰減每個引數組的學習率。
當 last_epoch=-1 時,將初始學習率設定為 lr。
- 引數
示例
>>> # Assuming optimizer uses lr = 0.001 for all groups >>> # lr = 0.001 if epoch == 0 >>> # lr = 0.00075 if epoch == 1 >>> # lr = 0.00050 if epoch == 2 >>> # lr = 0.00025 if epoch == 3 >>> # lr = 0.0 if epoch >= 4 >>> scheduler = PolynomialLR(optimizer, total_iters=4, power=1.0) >>> for epoch in range(100): >>> train(...) >>> validate(...) >>> scheduler.step()
- load_state_dict(state_dict)[source]¶
載入排程器的狀態。
- 引數
state_dict (dict) – 排程器狀態。應為呼叫
state_dict()返回的物件。