'Updates the learning rate according to the exponential decay schedule.
Parameters
algorithm : SGD
The SGD instance whose `learning_rate` field should be modified.'

def __call__(self, algorithm):

    if (self._count == 0):
        self._base_lr = algorithm.learning_rate.get_value()
    self._count += 1
    if (not self._min_reached):
        new_lr = (self._base_lr / (self.decay_factor ** self._count))
        if (new_lr <= self.min_lr):
            self._min_reached = True
            new_lr = self.min_lr
    else:
        new_lr = self.min_lr
    new_lr = np.cast[config.floatX](new_lr)
    algorithm.learning_rate.set_value(new_lr)
