scripts/optimizers.py
def _compute_step(self, grad):
        """
        Computes one Adam step based on the given gradient.
        
        :param grad: the gradient to optimize with
        :return: the step, size [dim]
        """
        a = self.stepsize * np.sqrt(1 - self.beta2 ** self.t) / (1 - self.beta1 ** self.t)
        self.m = self.beta1 * self.m + (1 - self.beta1) * grad
        self.v = self.beta2 * self.v + (1 - self.beta2) * (grad * grad)
        step = -a * self.m / (torch.sqrt(self.v) + self.epsilon)
        return step

        Computes one Adam step based on the given gradient.
        
        :param grad: the gradient to optimize with
        :return: the step, size [dim]
        
Computes one Adam step based on the given gradient.
Computes one Adam step based on the given gradient .
def _compute_step(self, grad):
        a = self.stepsize * np.sqrt(1 - self.beta2 ** self.t) / (1 - self.beta1 ** self.t)
        self.m = self.beta1 * self.m + (1 - self.beta1) * grad
        self.v = self.beta2 * self.v + (1 - self.beta2) * (grad * grad)
        step = -a * self.m / (torch.sqrt(self.v) + self.epsilon)
        return step
def _compute_step ( self , grad ) : a = self . stepsize * np . sqrt ( 1 - self . beta2 ** self . t ) / ( 1 - self . beta1 ** self . t ) self . m = self . beta1 * self . m + ( 1 - self . beta1 ) * grad self . v = self . beta2 * self . v + ( 1 - self . beta2 ) * ( grad * grad ) step = - a * self . m / ( torch . sqrt ( self . v ) + self . epsilon ) return step
Computes one Adam step based on the given gradient.
Computes one Adam step based on the given gradient .
"""
        Computes one Adam 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