torchoutil.optim.utils module

create_params_groups_bias(
model: Module | Iterable[Tuple[str, Parameter]],
weight_decay: float,
skip_list: Iterable[str] | None = (),
verbose: int = 2,
) List[Dict[str, List[Parameter] | float]][source]
get_lr(
optim: Optimizer,
idx: int = 0,
key: str = 'lr',
) float[source]

Get the learning rate of the first group of an optimizer.

Args:

optim: The optimizer to get. idx: The group index of the learning rate in the optimizer. defaults to 0.

get_lrs(
optim: Optimizer,
key: str = 'lr',
) List[float][source]

Get the learning rates in all groups of an optimizer.

Args:

optim: The optimizer to get.