Mercurial > hg > octave-avbm
changeset 9633:ecc2c556f844
simplify damped BFGS formula
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 11 Sep 2009 08:47:25 +0200 |
parents | 40acd13920e3 |
children | da5ba66414a3 |
files | scripts/ChangeLog scripts/optimization/fminunc.m |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-09-11 Jaroslav Hajek <highegg@gmail.com> + + * optimization/fminunc.m: Simplify damped BFGS calculation. + 2009-09-09 Tatsuro Matsuoka <tmacchant@yahoo.co.jp> * plot/gnuplot_drawnow.m: Avoid flickering windows by avoding
--- a/scripts/optimization/fminunc.m +++ b/scripts/optimization/fminunc.m @@ -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), "-");