Skip to content

utils

default_optimizer_tuple()

Returns:

Type Description
Tuple[torch.optim.Optimizer, Dict[str, Any]]

A tuple to be passed into an Optimizers container. The tuple specifies an Adam optimizer with lr 0.0001.

Source code in pytorch_adapt\adapters\utils.py
 7
 8
 9
10
11
12
13
def default_optimizer_tuple() -> Tuple[torch.optim.Optimizer, Dict[str, Any]]:
    """
    Returns:
        A tuple to be passed into an [Optimizers][pytorch_adapt.containers.Optimizers]
            container. The tuple specifies an Adam optimizer with lr 0.0001.
    """
    return (torch.optim.Adam, {"lr": 0.0001})