# HG changeset patch # User Jaroslav Hajek # Date 1252651645 -7200 # Node ID ecc2c556f844b30734ac42e2474e90d593197bcf # Parent 40acd13920e36f2e0ac9318cf9f96017ecd8a515 simplify damped BFGS formula diff -r 40acd13920e3 -r ecc2c556f844 scripts/ChangeLog --- a/scripts/ChangeLog Wed Sep 09 19:41:29 2009 -0400 +++ b/scripts/ChangeLog Fri Sep 11 08:47:25 2009 +0200 @@ -1,3 +1,7 @@ +2009-09-11 Jaroslav Hajek + + * optimization/fminunc.m: Simplify damped BFGS calculation. + 2009-09-09 Tatsuro Matsuoka * plot/gnuplot_drawnow.m: Avoid flickering windows by avoding diff -r 40acd13920e3 -r ecc2c556f844 scripts/optimization/fminunc.m --- a/scripts/optimization/fminunc.m Wed Sep 09 19:41:29 2009 -0400 +++ b/scripts/optimization/fminunc.m Fri Sep 11 08:47:25 2009 +0200 @@ -170,11 +170,7 @@ sBs = sumsq (w); Bs = hesr'*w; sy = y'*s; - if (sy >= 0.2*sBs) - theta = 1; - else - theta = 0.8*sBs / (sBs - sy); - endif + theta = 0.8 / max (1 - sy / sBs, 0.8); r = theta * y + (1-theta) * Bs; hesr = cholupdate (hesr, r / sqrt (s'*r), "+"); [hesr, info] = cholupdate (hesr, Bs / sqrt (sBs), "-");