def summed_objective_params_func(params, inputs, module):
    """
    Function that sets parameters of a module and sums the fprop output
    of the module.
    """
    module.params[:] = params
    return module.fprop(inputs.reshape(module.imsize)).sum()