MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / set_lr

Function set_lr

slowfast/models/optimizer.py:117–125  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

115
116
117def 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected