CosineDecayer#
- class stable_ssl.optim.CosineDecayer(total_steps, n_cycles=3, gamma=0.2)[source]#
Bases:
object
Apply cosine decay with multiple cycles for learning rate scheduling.
This class implements a cosine decay function with multiple cycles that can be used as a learning rate scheduler. The decay follows a cosine curve with additional cyclic variations.
- Parameters:
Example
>>> decayer = CosineDecayer(total_steps=1000, n_cycles=3) >>> lr_factor = decayer(step=500)