scripts/optimizers.py
def _compute_step(self, grad):
        """
        Computes one Momentum-SGD step based on the given gradient.
        
        :param grad: the gradient to optimize with
        :return: the step, size [dim]
        """
        self.v = self.momentum * self.v + (1. - self.momentum) * grad
        step = -self.stepsize * self.v
        return step

        Computes one Momentum-SGD step based on the given gradient.
        
        :param grad: the gradient to optimize with
        :return: the step, size [dim]
        
Computes one Momentum-SGD step based on the given gradient.
Computes one Momentum - SGD step based on the given gradient .
def _compute_step(self, grad):
        self.v = self.momentum * self.v + (1. - self.momentum) * grad
        step = -self.stepsize * self.v
        return step
def _compute_step ( self , grad ) : self . v = self . momentum * self . v + ( 1. - self . momentum ) * grad step = - self . stepsize * self . v return step
Computes one Momentum-SGD step based on the given gradient.
Computes one Momentum - SGD step based on the given gradient .
"""
        Computes one Momentum-SGD step based on the given gradient.
        
        :param grad: the gradient to optimize with
        :return: the step, size [dim]
        """
the step, size [dim]
the step size [ dim ]
self
grad
the gradient to optimize with
the gradient to optimize with