def momentum_core(params, gradients, momentum=<NUM_LIT>, learning_rate=<NUM_LIT>):
free_parameters = []<EOL>updates = []<EOL>for param, grad in zip(params, gradients):<EOL><INDENT>delta = learning_rate * grad<EOL>velocity = theano.shared(np.zeros_like(param.get_value()), name=param.name + '<STR_LIT>')<EOL>updates.append((velocity, momentum * velocity - delta))<EOL>updates.append((param, param + velocity))<EOL>free_parameters.append(velocity)<EOL><DEDENT>return updates, free_parameters<EOL>
Momentum SGD optimization core.