def get_updates(self, learning_rate, grads, lr_scalers=None):
        """
        Compute the AdaGrad updates

        Parameters
        ----------
        learning_rate : float
            Learning rate coefficient.
        grads : dict
            A dictionary mapping from the model's parameters to their
            gradients.
        lr_scalers : dict
            A dictionary mapping from the model's parameters to a learning
            rate multiplier.
        """
        updates = OrderedDict()
        for param in grads.keys():

            # sum_square_grad := \sum g^2
            sum_square_grad = sharedX(param.get_value() * 0.)

            if param.name is not None:
                sum_square_grad.name = 'sum_square_grad_' + param.name

            # Accumulate gradient
            new_sum_squared_grad = (
                sum_square_grad + T.sqr(grads[param])
            )

            # Compute update
            epsilon = lr_scalers.get(param, 1.) * learning_rate
            scale = T.maximum(self.eps, T.sqrt(new_sum_squared_grad))
            delta_x_t = (-epsilon / scale * grads[param])

            # Apply update
            updates[sum_square_grad] = new_sum_squared_grad
            updates[param] = param + delta_x_t

        return updates
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/training_algorithms/learning_rule.py/AdaGrad.get_updates/original