self.updates = [(self.iterations, self.iterations + 1.)]
for p, g, c in zip(params, grads, constraints):
m = shared_zeros(p.get_value().shape) // momentum
v = self.momentum * m - lr * g // velocity
self.updates.append((m, v))
After Change
def get_updates(self, params, constraints, grads):
lr = self.lr * (1.0 / (1.0 + self.decay * self.iterations))
self.updates = [(self.iterations, self.iterations + 1.)]
new_weights = []
for p, g, c in zip(params, grads, constraints):
m = np.zeros_like(p) // momentum
v = self.momentum * m - lr * g // velocity