Sets the optimizer lr to the specified value. Args: optimizer (optim): the optimizer using to optimize the current network. new_lr (float): the new learning rate to set.
(optimizer, new_lr)
| 115 | |
| 116 | |
| 117 | def set_lr(optimizer, new_lr): |
| 118 | """ |
| 119 | Sets the optimizer lr to the specified value. |
| 120 | Args: |
| 121 | optimizer (optim): the optimizer using to optimize the current network. |
| 122 | new_lr (float): the new learning rate to set. |
| 123 | """ |
| 124 | for param_group in optimizer.param_groups: |
| 125 | param_group["lr"] = new_lr |
nothing calls this directly
no outgoing calls
no test coverage detected