def optimize_function(params, config=None):
gs = [dim_to_var(p.ndim) for p in params]<EOL>updates, _ = optimize_updates(params, gs, config)<EOL>return theano.function(gs, [], updates=updates)<EOL>
Create a optimizing function receives gradients.
Parameters:
    params - parameters
    config - training configuration
Returns:
    updating function receives gradients