I am trying to execute the following optimization.
res = optimize( Optim.only_fg!((F, G, Az)->fg!(F,G,first(Az),x,z)), [100000.0],[500000.0],[400000.0],Fminbox(GradientDescent()),Optim.Options(iterations=10,show_trace=true,f_tol=1e-7,extended_trace=true,g_tol=1e-8))
where I have defined
function fg!(F,G,Az,xVal,zVal)
# common computations not done in this example
if G != nothing
G .= dX3dAz(Az,xVal,zVal)
end
if F != nothing
return X3(Az,xVal,zVal)
end
end
When I look at the trace printout, the three columns are: Iter Function value Gradient norm
. The value printed out for “Function value” does not match what I would expect for my function X3
. Could someone explain what exactly the “Function value” is being calculated from? Is it a weighting from the function and gradient? Is this discussed in the documentation anywhere? I wasn’t able to find anything.
Also, I know I haven’t included the functions X3
and dX3dAz
as they very long, complicated expressions. However, I hope my question can be answered regardless. Thank you.