def gen_updates_nesterov_momentum(loss, all_parameters, learning_rate,
                                  momentum, weight_decay):
    all_grads = [theano.grad(loss, param) for param in all_parameters]
    updates = []
    for param_i, grad_i in zip(all_parameters, all_grads):
        mparam_i = theano.shared(param_i.get_value() * 0.)
        full_grad = grad_i + weight_decay * param_i
        # new momemtum
        v = learning_rate * full_grad - momentum * mparam_i
        # new parameter values
        w = param_i + momentum * v - learning_rate * full_grad
        updates.append((mparam_i, v))
        updates.append((param_i, w))
    return updates
dataset/ETHPy150Open ifp-uiuc/anna/anna/layers/layers.py/gen_updates_nesterov_momentum/swapped operands of `-`