def _get_directions(self):
        directions = OrderedDict()

        for i, (param, gradient) in enumerate(self.loss.gradients.items()):
            # sum_squared_grad := \sum g_t^2
            param_name = param.name if param.name is not None else str(i)
            sum_squared_grad = sharedX(np.zeros_like(param.get_value()), name='sum_squared_grad_' + param_name)
            self.parameters[sum_squared_grad.name] = sum_squared_grad

            # Accumulate gradient
            new_sum_squared_grad = sum_squared_grad + T.sqr(gradient)

            # Compute update
            root_sum_squared = T.sqrt(new_sum_squared_grad + self.eps)

            # Apply update
            self._updates[sum_squared_grad] = new_sum_squared_grad
            directions[param] = -(self.lr/root_sum_squared) * gradient

        return directions
Produces descending directions.
dataset/ETHPy150Open SMART-Lab/smartlearner/smartlearner/optimizers/adagrad.py/AdaGrad._get_directions