deeplabcut.pose_estimation_pytorch.runners.schedulers
Classes:
| Name | Description |
|---|---|
LRListScheduler |
You can achieve increased performance and faster training by using a learning |
Functions:
| Name | Description |
|---|---|
build_scheduler |
Builds a scheduler from a configuration, if defined. |
load_scheduler_state |
Args: |
LRListScheduler
Bases: _LRScheduler
You can achieve increased performance and faster training by using a learning rate that changes during training.
A scheduler makes the learning rate adaptive. Given a list of learning rates and milestones modifies the learning rate accordingly during training.
Methods:
| Name | Description |
|---|---|
__init__ |
Args: |
get_lr |
Summary: |
Source code in deeplabcut/pose_estimation_pytorch/runners/schedulers.py
__init__
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
optimizer used for learning. |
required | |
|
number of epochs. |
required | |
|
learning rate list. |
required | |
|
where to start the scheduler. (-1: start from beginning) |
-1
|
Examples:
input: last_epoch = -1 verbose = False milestones = [10, 30, 40] lr_list = [[0.00001],[0.000005],[0.000001]]
Source code in deeplabcut/pose_estimation_pytorch/runners/schedulers.py
get_lr
Summary: Given a milestones, get the corresponding learning rate.
Returns:
| Name | Type | Description |
|---|---|---|
lr |
learning rate value |
Examples:
input: LRListScheduler object output: learning rate (lr) = [0.001]
Source code in deeplabcut/pose_estimation_pytorch/runners/schedulers.py
build_scheduler
build_scheduler(scheduler_cfg: dict | None, optimizer: Optimizer) -> torch.optim.lr_scheduler.LRScheduler | None
Builds a scheduler from a configuration, if defined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | None
|
the configuration of the scheduler to build |
required |
|
Optimizer
|
the optimizer the scheduler will be built for |
required |
Returns:
| Type | Description |
|---|---|
LRScheduler | None
|
None if scheduler_cfg is None, otherwise the scheduler |
Source code in deeplabcut/pose_estimation_pytorch/runners/schedulers.py
load_scheduler_state
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LRScheduler
|
The scheduler for which to load the state dict. |
required |
|
dict
|
The state dict to load |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the state dict fails to load. |