Update the (expected) value of the objective function in an adaQN_free object, after it has been requested by the optimizer (do NOT update it otherwise).
update_fun(optimizer, fun)
Arguments
optimizer: An adaQN_free object which after the last run had requested a new function evaluation.
fun: Function as evaluated (in expectation) on the values of x that were returned in the request.