Here
Or to be precise, in the curvature test section of TrustRegionNewtonCG, the function self.mk is called, but as far as I see, it isn't defined anywhere:
I tried to write my own function of self.mk for the curvature test, but I'm not sure if I understand the algorithm correctly.
def mk(self, obj, xk, p):
fxk = obj(xk)
gxk = obj.derivative(xk)
Hxk_p = obj.hessian(xk)(p)
model_value = fxk + gxk.apply(p) + 0.5 * Hxk_p.apply(p)
return model_value
I'd like to then ask if this is a bug or this is a misunderstanding of the code from my side?
Thank you in advance for your answer!