https://github.com/avik-pal/optim.jl
Optimization functions for Julia
Science Score: 41.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: joss.theoj.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.4%) to scientific vocabulary
Repository
Optimization functions for Julia
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Optim.jl
Univariate and multivariate optimization in Julia.
Optim.jl is part of the JuliaNLSolvers family.
Help and support
For help and support, please post on the Optimization (Mathematical)
section of the Julia discourse or the #math-optimization channel of the Julia slack.
Installation
Install Optim.jl using the Julia package manager:
julia
import Pkg
Pkg.add("Optim")
Documentation
The online documentation is available at https://julianlsolvers.github.io/Optim.jl/stable.
Example
To minimize the Rosenbrock function, do: ```julia julia> using Optim
julia> rosenbrock(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2 rosenbrock (generic function with 1 method)
julia> result = optimize(rosenbrock, zeros(2), BFGS()) * Status: success
Candidate solution Final objective value: 5.471433e-17
Found with Algorithm: BFGS
Convergence measures |x - x'| = 3.47e-07 ≰ 0.0e+00 |x - x'|/|x'| = 3.47e-07 ≰ 0.0e+00 |f(x) - f(x')| = 6.59e-14 ≰ 0.0e+00 |f(x) - f(x')|/|f(x')| = 1.20e+03 ≰ 0.0e+00 |g(x)| = 2.33e-09 ≤ 1.0e-08
Work counters Seconds run: 0 (vs limit Inf) Iterations: 16 f(x) calls: 53 ∇f(x) calls: 53
julia> Optim.minimizer(result) 2-element Vector{Float64}: 0.9999999926033423 0.9999999852005355
julia> Optim.minimum(result) 5.471432670590216e-17 ```
To get information on the keywords used to construct method instances, use the
Julia REPL help prompt (?)
```julia
help?> LBFGS
search: LBFGS
LBFGS ≡≡≡≡≡
Constructor ===========
LBFGS(; m::Integer = 10, alphaguess = LineSearches.InitialStatic(), linesearch = LineSearches.HagerZhang(), P=nothing, precondprep = (P, x) -> nothing, manifold = Flat(), scaleinvH0::Bool = true && (typeof(P) <: Nothing))
LBFGS has two special keywords; the memory length m, and the scaleinvH0 flag. The memory length determines how many previous Hessian approximations to store. When scaleinvH0 == true, then the initial guess in the two-loop recursion to approximate the inverse Hessian is the scaled identity, as can be found in Nocedal and Wright (2nd edition) (sec. 7.2).
In addition, LBFGS supports preconditioning via the P and precondprep keywords.
Description ===========
The LBFGS method implements the limited-memory BFGS algorithm as described in Nocedal and Wright (sec. 7.2, 2006) and original paper by Liu & Nocedal (1989). It is a quasi-Newton method that updates an approximation to the Hessian using past approximations as well as the gradient.
References ==========
• Wright, S. J. and J. Nocedal (2006), Numerical optimization, 2nd edition.
Springer
• Liu, D. C. and Nocedal, J. (1989). "On the Limited Memory Method for
Large Scale Optimization". Mathematical Programming B. 45 (3): 503–528
```
Use with JuMP
You can use Optim.jl with JuMP.jl as follows:
```julia julia> using JuMP, Optim
julia> model = Model(Optim.Optimizer);
julia> setoptimizerattribute(model, "method", BFGS())
julia> @variable(model, x[1:2]);
julia> @objective(model, Min, (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2) (x[1]² - 2 x[1] + 1) + (100.0 * ((-x[1]² + x[2]) ^ 2.0))
julia> optimize!(model)
julia> objective_value(model) 3.7218241804173566e-21
julia> value.(x) 2-element Vector{Float64}: 0.9999999999373603 0.99999999986862 ```
Citation
If you use Optim.jl in your work, please cite the following:
tex
@article{mogensen2018optim,
author = {Mogensen, Patrick Kofod and Riseth, Asbj{\o}rn Nilsen},
title = {Optim: A mathematical optimization package for {Julia}},
journal = {Journal of Open Source Software},
year = {2018},
volume = {3},
number = {24},
pages = {615},
doi = {10.21105/joss.00615}
}
Owner
- Name: Avik Pal
- Login: avik-pal
- Kind: user
- Location: Cambridge, MA
- Company: Massachusetts Institute of Technology
- Website: https://avik-pal.github.io
- Twitter: avikpal1410
- Repositories: 46
- Profile: https://github.com/avik-pal
PhD Student @mit || Prev: BTech CSE IITK
Citation (CITATION.bib)
@article{Optim.jl-2018,
author = {Mogensen, Patrick Kofod and Riseth, Asbj{\o}rn Nilsen},
title = {Optim: A mathematical optimization package for {Julia}},
journal = {Journal of Open Source Software},
year = {2018},
volume = {3},
number = {24},
pages = {615},
doi = {10.21105/joss.00615}
}
GitHub Events
Total
- Issue comment event: 1
- Push event: 5
- Pull request event: 5
- Create event: 1
Last Year
- Issue comment event: 1
- Push event: 5
- Pull request event: 5
- Create event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 3
Past Year
- Issues: 0
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
Pull Request Authors
- pull[bot] (5)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- JuliaRegistries/TagBot v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest latest composite
- julia-actions/julia-uploadcodecov latest composite
- julia-actions/setup-julia v1 composite