diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2012-05-02 23:07:44 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2012-05-02 23:07:44 +0400 |
commit | 6c45836d1f975ba15f7aee50e093f1944b27b5fe (patch) | |
tree | 10c9d99772d4c87bbaf13a778336194a5054e65f /lbfgs.lua | |
parent | 42cb83a21e09903fd7f3a8e1d754cedfbf5a7faf (diff) |
Added first line search.
Diffstat (limited to 'lbfgs.lua')
-rw-r--r-- | lbfgs.lua | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ ---------------------------------------------------------------------- --- An implementation of L-BFGS, heavily inspired from minFunc. +-- An implementation of L-BFGS, heavily inspired by minFunc (Mark Schmidt) -- -- This implementation of L-BFGS relies on a user-provided line -- search function (state.lineSearch). If this function is not @@ -42,8 +42,7 @@ function optim.lbfgs(opfunc, x, state) local tolX = state.tolX or 1e-9 local nCorrection = state.nCorrection or 100 local lineSearch = state.lineSearch - local c1 = state.lineSearchDecrease or 1e-4 - local c2 = state.lineSearchCurvature or 0.9 + local lineSearchOpts = state.lineSearchOptions local learningRate = state.learningRate or 1 local isverbose = state.verbose or false @@ -192,7 +191,7 @@ function optim.lbfgs(opfunc, x, state) local lsFuncEval = 0 if lineSearch and type(lineSearch) == 'function' then -- perform line search, using user function - f,g,x,t,lsFuncEval = lineSearch(opfunc,x,t,d,f,g,gtd,c1,c2,tolX) + f,g,x,t,lsFuncEval = lineSearch(opfunc,x,t,d,f,g,gtd,lineSearchOpts) append(f_hist, f) else -- no line search, simply move with fixed-step |