Skip to content

Commit

Permalink
Newton method: ensure that linesearch always starts with a step size …
Browse files Browse the repository at this point in the history
…of 1.
  • Loading branch information
Sébastien Villemot committed Dec 30, 2014
1 parent 39c4961 commit b147866
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function newton{T}(df::DifferentiableMultivariateFunction,

# Keep track of step-sizes
foval = dfo.fg!(x, gr)
alpha = Optim.alphainit(one(T), x, gr, foval)

while !converged && it < iterations

Expand Down Expand Up @@ -119,7 +118,7 @@ function newton{T}(df::DifferentiableMultivariateFunction,
push!(lsr, zero(T), 0.5*dot(fvec,fvec), dot(g, p))

alpha, f_calls_update, g_calls_update =
linesearch!(dfo, xold, p, x, gr, lsr, alpha, mayterminate)
linesearch!(dfo, xold, p, x, gr, lsr, one(T), mayterminate)

f_calls += f_calls_update
g_calls += g_calls_update
Expand Down

0 comments on commit b147866

Please sign in to comment.