o
    }o™i‚  ã                   @   s,   d dl mZmZ G dd„ deƒZeed< dS )é    )ÚAVAILABLE_SCHEDULERSÚCosineAnnealingc                       s*   e Zd ZdZddddœ‡ fdd„
Z‡  ZS )ÚCosineAnnealingExpzÀ
    Setting max_steps_for_lr_sched for this scheduler in the config is experimental and "
    not recommended. The scheduler can use max_steps automatically from "
    trainer.max_steps.
    r   éÿÿÿÿN)Úmin_lrÚ
last_epochÚmax_steps_for_lr_schedc                   sB   t ƒ jd||||dœ|¤Ž |r|| _| j| j| j  | _d S d S )N)Ú	optimizerÚ	max_stepsr   r   © )ÚsuperÚ__init__r
   Úconstant_stepsÚwarmup_stepsÚdecay_steps)Úselfr	   r
   r   r   r   Úkwargs©Ú	__class__r   úe/home/ubuntu/.local/lib/python3.10/site-packages/nemo/collections/nlp/parts/megatron_lr_schedulers.pyr      s
   þzCosineAnnealingExp.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r   r      s    r   N)Únemo.core.optim.lr_schedulerr   r   r   r   r   r   r   Ú<module>   s   