carpet/lista_base.py
def _update_parameters(self, parameters, lr):
        """ Parameters update step for the gradient descent. """
        max_norm_grad = 0.0

        for param in parameters:
            if param.grad is not None:
                # do a descent step
                param.data.add_(-lr, param.grad.data)
                # compute gradient max norm
                current_norm_grad = param.grad.data.abs().max()
                max_norm_grad = max(max_norm_grad, current_norm_grad)

        return max_norm_grad
 Parameters update step for the gradient descent. 
Parameters update step for the gradient descent.
Parameters update step for the gradient descent .
def _update_parameters(self, parameters, lr):
        max_norm_grad = 0.0
        for param in parameters:
            if param.grad is not None:
                param.data.add_(-lr, param.grad.data)
                current_norm_grad = param.grad.data.abs().max()
                max_norm_grad = max(max_norm_grad, current_norm_grad)
        return max_norm_grad
def _update_parameters ( self , parameters , lr ) : max_norm_grad = 0.0 for param in parameters : if param . grad is not None : param . data . add_ ( - lr , param . grad . data ) current_norm_grad = param . grad . data . abs ( ) . max ( ) max_norm_grad = max ( max_norm_grad , current_norm_grad ) return max_norm_grad
Parameters update step for the gradient descent.
Parameters update step for the gradient descent .
""" Parameters update step for the gradient descent. """ # do a descent step # compute gradient max norm
self
parameters
lr