You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param proc_progress The callback function to receive the progress
* (the number of iterations, the current value of
* the objective function) of the minimization
* process. This argument can be set to \c NULL if
* a progress report is unnecessary.
The current situation is not desirable as a user might write a callback function that returns a value that is not intended to be used as the return value of lbfgs().
I noticed that when a callback function returns non-zero value, the value is used as a return value of
lbfgs()
.liblbfgs/lib/lbfgs.c
Lines 495 to 500 in 5ad02fb
But this behavior is not documented, e.g. at
liblbfgs/include/lbfgs.h
Lines 403 to 404 in 5ad02fb
or
liblbfgs/include/lbfgs.h
Lines 461 to 465 in 5ad02fb
The current situation is not desirable as a user might write a callback function that returns a value that is not intended to be used as the return value of
lbfgs()
.I think it's better to either:
lbfgs()
always returnLBFGSERR_CANCELED
on cancel, ignoring the actual return value of the callback (Make lbfgs() to return LBFGSERR_CANCELED when callback function returns non-zero value #38)The text was updated successfully, but these errors were encountered: