Mantis - ALGLIB
Viewing Issue Advanced Details
822 Optimization minor have not tried 2018-08-20 17:49 2018-12-27 18:12
SergeyB  
SergeyB  
normal  
resolved  
fixed  
none    
none 3.15.0  
Unspecified
0000822: FIXED: gradient checking functionality in nonlinear optimizers does not handle scaling properly
=== ORIGINAL REPORT BY USER ===
Problem: When I run minlbfgssetgradientcheck(state, 1e-4) to verify that the numerical gradient is accurate enough, I only get a good result when the scale is set to 1 for each variable. If I first set the scale the way I think is desirable using minlbfgssetscale(state, s), I always get the -7 status. My hypothesis is that the gradient check does not take the scale into account properly. More specifically, I think that the line

 

    if( !derivativecheck(state->fm1, state->fp1, state->fm2, state->fp2, state->f, state->g.ptr.p_double[i], 2*state->teststep, _state) )

 

should be:

 

    if( !derivativecheck(state->fm1, state->fp1, state->fm2, state->fp2, state->f, state->g.ptr.p_double[i], 2*state->teststep * state->s.ptr.p_double[i], _state) )

 

to take the scaling properly into account.

=== SOLUTION ===

Switched everything to new OptGuard API which has this error fixed.
Issue History
2018-08-20 17:49 SergeyB New Issue
2018-08-20 17:49 SergeyB Status new => assigned
2018-08-20 17:49 SergeyB Assigned To => SergeyB
2018-08-20 17:49 SergeyB Programming language => Unspecified
2018-12-24 16:57 SergeyB Summary gradient checking functionality in nonlinear optimizers does not handle scaling properly => FIXED: gradient checking functionality in nonlinear optimizers does not handle scaling properly
2018-12-24 16:57 SergeyB Description Updated
2018-12-24 16:57 SergeyB Status assigned => resolved
2018-12-24 16:57 SergeyB Fixed in Version => 3.15.0
2018-12-24 16:57 SergeyB Resolution open => fixed
2018-12-27 18:12 SergeyB Category General => Optimization

There are no notes attached to this issue.