[Insight-developers] Proper use of SetCostFunctionConvergenceFactor

Bill Lorensen bill.lorensen at gmail.com
Tue Apr 8 10:18:23 EDT 2008


Guys,

I noticed that a couple of registration examples that use the lbfgsb
optimizer were setting the cost function convergence factor as though
it were an epsilon. Actually, it is a factor that is multiplied times
the machine precision to compute. Hence, a number < 1 (some examples
used 1.e-35) result in a tolerance below the precision of the machine.
As stated in the comments of the optimizer:

/** Set/Get the CostFunctionConvergenceFactor. Algorithm terminates
   * when the reduction in cost function is less than factor * epsmcj
   * where epsmch is the machine precision.
   * Typical values for factor: 1e+12 for low accuracy;
    * 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy.
    */

I fixed two examples. They were occasionally failing on some
platforms. On the Borland platform at least one was aborting on a
divide by zero.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Examples/Registration/DeformableRegistration12.cxx?root=Insight&r1=1.9&r2=1.10
http://public.kitware.com/cgi-bin/viewcvs.cgi/Examples/Registration/DeformableRegistration8.cxx?root=Insight&r1=1.22&r2=1.23

Maybe we should put a check in the Set method to prevent future misuse
of this variable.

Bill


More information about the Insight-developers mailing list