lr_scaler
zeus.utils.lr_scaler
Classes that enclose learning rate scaling rules.
SquareRootScaler
dataclass
Square root scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bs |
int
|
The initial batch size |
required |
lr |
float
|
The initial learning rate |
required |
Source code in zeus/utils/lr_scaler.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
compute_lr
compute_lr(new_bs)
Compute the scaled learning rate given the new batch size.
Source code in zeus/utils/lr_scaler.py
19 20 21 |
|
LinearScaler
dataclass
Linear scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bs |
int
|
The initial batch size |
required |
lr |
float
|
The initial learning rate |
required |
Source code in zeus/utils/lr_scaler.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
compute_lr
compute_lr(new_bs)
Compute the scaled learning rate given the new batch size.
Source code in zeus/utils/lr_scaler.py
36 37 38 |
|