exp
ExponentDecayLr
Bases: OptimScheduler
ExponentDecayLr is a class that inherits from OptimScheduler and implements an exponential decay learning rate scheduler.
It updates the learning rate based on the epoch number using the provided decay factor.
Source code in speechain/optim_sche/exp.py
extra_repr_fn()
Returns a string representation of the ExponentDecayLr object, including the decay factor.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the class name and the decay factor value. |
Source code in speechain/optim_sche/exp.py
sche_init(decay_factor=0.999)
Initializes the exponential decay learning rate scheduler with the given decay factor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
decay_factor
|
float
|
The decay factor that will be used to exponentially decay the learning rate. Defaults to 0.999. |
0.999
|
Source code in speechain/optim_sche/exp.py
update_lr(real_step, epoch_num)
Updates the learning rate based on the current epoch number and the decay factor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
real_step
|
int
|
The current step in the optimization process. Not used in this implementation, but required for compatibility with the base class. |
required |
epoch_num
|
int
|
The current epoch number. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The updated learning rate. |