nlpmodels/utils/optims.py
def calc_lr(self, step: int) -> float:
        """
        Implements the LR schedule described in Attention (2017).

        Returns:
            New learning rate as a function of step.
        """
        return self._factor * ((self._dim_model ** (-0.5)) *
                               min(step ** (-0.5), (step * self._warm_up ** (-1.5))))

        Implements the LR schedule described in Attention (2017).

        Returns:
            New learning rate as a function of step.
        
Implements the LR schedule described in Attention (2017).
Implements the LR schedule described in Attention ( 2017 ) .
def calc_lr(self, step: int) -> float:
        return self._factor * ((self._dim_model ** (-0.5)) *
                               min(step ** (-0.5), (step * self._warm_up ** (-1.5))))
def calc_lr ( self , step : int ) -> float : return self . _factor * ( ( self . _dim_model ** ( - 0.5 ) ) * min ( step ** ( - 0.5 ) , ( step * self . _warm_up ** ( - 1.5 ) ) ) )
Implements the LR schedule described in Attention (2017).
Implements the LR schedule described in Attention ( 2017 ) .
"""
        Implements the LR schedule described in Attention (2017).

        Returns:
            New learning rate as a function of step.
        """
New learning rate as a function of step.
New learning rate as a function of step .
self
step
int