checkgradient and checkhessian for exact models

32 views
Skip to first unread message

Jesus Briales

unread,
Jan 24, 2017, 11:34:23 AM1/24/17
to Manopt
Hi everyone,
I have come into an issue while using checkhessian in a very particular case:
Checking a problem involving only linear manifolds and a quadratic function.
In this case the (2nd order) truncated Taylor expansion is actually exact (up to numerical precision),
so the approximation error is always zero, whatever the value of the step h in the Hessian check plot.

Since I'm used to do a quick check visually comparing the slope of the error
to the reference slope (which should usually be 3 in both cases),
I was visualizing just a noisy output for the approximation error (near the machine epsilon).
This got me totally confused for a while, until I stopped for a moment,
revisited the description of checkhessian in the webpage,
and made sense of the output: The model was exact.

So, to sum up, this a quite unusual case. Yet I looked for any related topic in the forum and couldn't find anything,
so I thought it would be interesting to share it here.
Also, I think this special case could be easily detected in the checkdiff and checkhessian functions
by checking if the approximation error is very close to zero for all h. Launching a warning
or explicit comment pointing to the case of exact approximation would be useful then
to avoid any misleading for those absent-minded as me :)

Regards,

J Briales

Nicolas Boumal

unread,
Jan 24, 2017, 5:52:10 PM1/24/17
to Manopt
Hello Jesus,

Thank you for sharing this practical story, we appreciate it!

Would you like to propose a snippet of code to add to check*** functions to test for that case? I'll be happy to add it. Or you can also use our github to propose the change, if that's just as easy for you: https://github.com/NicolasBoumal/manopt.

Thanks!
Nicolas
Reply all
Reply to author
Forward
0 new messages