[Insight-users] LBFGSB Optimizer

Tim Allman dr.tim.allman at gmail.com
Tue Mar 26 10:59:31 EDT 2013


I wanted to set the cost function convergence criterion to zero in my 
code in order to turn off termination due to this criterion. The code 
threw an exception that originated in this code.

void
LBFGSBOptimizer
::SetCostFunctionConvergenceFactor(double value)
{
   if ( value < 1.0 )
     {
     itkExceptionMacro("Value " << value
                                << " is too small for 
SetCostFunctionConvergenceFactor()"
                                << "a typical range would be from 1.0 to 
1e+12");
     }

The authors of the algorithm and the Fortran code that ITK uses specify 
in their example driver the following where factr is the parameter that 
is eventually set by SetCostFunctionConvergence Factor() and pgtol is 
the parameter that is set by SetProjectedGradientTolerance(). They make 
it clear here and in other docs that setting one or the other to zero is 
expected use. You can even set them both to zero if you have a 
termination criterion in the driver.

Effectively, the ITK class is the driver and perhaps a better behaviour 
for it would be for LBFGSBOptimizer::StartOptimization() to throw if 
both arguments were zero but be happy if only one were. Does this sound 
reasonable?

c     factr is a DOUBLE PRECISION variable that must be set by the user.
c       It is a tolerance in the termination test for the algorithm.
c       The iteration will stop when
c
c        (f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsmch
c
c       where epsmch is the machine precision which is automatically
c       generated by the code. Typical values for factr on a computer
c       with 15 digits of accuracy in double precision are:
c       factr=1.d+12 for low accuracy;
c             1.d+7  for moderate accuracy;
c             1.d+1  for extremely high accuracy.
c       The user can suppress this termination test by setting factr=0.
c
c     pgtol is a double precision variable.
c       On entry pgtol >= 0 is specified by the user.  The iteration
c         will stop when
c
c                 max{|proj g_i | i = 1, ..., n} <= pgtol
c
c         where pg_i is the ith component of the projected gradient.
c       The user can suppress this termination test by setting pgtol=0.
c

Thanks,
Tim

-- 
Tim Allman, Ph.D.
35 Margaret Street,
Guelph Ontario N1E 5R6
Canada

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dr_tim_allman.vcf
Type: text/x-vcard
Size: 159 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130326/7364b9af/attachment.vcf>


More information about the Insight-users mailing list