Skip to content

Commit

Permalink
Merge pull request #2 from pkofod/master
Browse files Browse the repository at this point in the history
Fix LevenbergMarquardt trace constructor to match Optim v0.5.
  • Loading branch information
omalled committed Jun 8, 2016
2 parents 9f70ee7 + bdc7f27 commit 1664109
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BIGUQ
RobustPmap
Lora
HDF5
Optim
Optim 0.5
BlackBoxOptim
Distributions
DataStructures
Expand Down
6 changes: 3 additions & 3 deletions src/MadsLM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function naive_levenberg_marquardt(f::Function, g::Function, x0::Vector, o::Func
break
end
end
return Optim.MultivariateOptimizationResults("Naive Levenberg-Marquardt", x0, currentx, currentsse, maxIter, false, false, 0.0, false, 0.0, false, 0.0, Optim.OptimizationTrace(), nEval, maxIter)
return Optim.MultivariateOptimizationResults("Naive Levenberg-Marquardt", x0, currentx, currentsse, maxIter, false, false, 0.0, false, 0.0, false, 0.0, Optim.OptimizationTrace(Optim.LevenbergMarquardt()), nEval, maxIter)
end

"""
Expand All @@ -176,7 +176,7 @@ Arguments:
- `maxIter` : maximum number of optimization iterations
- `maxJacobians` : maximum number of Jacobian solves
- `lambda` : initial Levenberg-Marquardt lambda [eps(Float32)]
- `lambda_scale` : lambda scaling factor
- `lambda_scale` : lambda scaling factor
- `lambda_mu` : lambda multiplication factor μ [10]
- `lambda_nu` : lambda multiplication factor ν [10]
- `np_lambda` : number of parallel lambda solves
Expand Down Expand Up @@ -235,7 +235,7 @@ function levenberg_marquardt(f::Function, g::Function, x0, o::Function=x->(x'*x)
Mads.madsoutput("""Initial OF: $residual\n"""; level = 1);

# Maintain a trace of the system.
tr = Optim.OptimizationTrace()
tr = Optim.OptimizationTrace(Optim.LevenbergMarquardt())
if !Mads.quiet && show_trace
d = @Compat.compat Dict("lambda" => lambda)
os = Optim.OptimizationState(iterCt, o(fcur), NaN, d)
Expand Down

0 comments on commit 1664109

Please sign in to comment.