On Wednesday, September 3, 2014 9:05:07 AM UTC-4, Alex wrote: > > ## Make "Container" Function because I can only optimize over x, even > though z is still a parameter > function test_max(x,z) > x[1]^2 + z > end >
This is a bit more complicated than is necessary. Just write your
objective as
function func(x, z, grad)
...
end
and then set the objective via:
min_objective!(opt, (x,grad) -> func(x,z,grad))
Closures are your friends!
