Optim

Optim: A mathematical optimization package for Julia - Published in JOSS (2018)

https://github.com/julianlsolvers/optim.jl

Science Score: 100.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
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    10 of 122 committers (8.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

julia optim optimisation optimization unconstrained-optimisation unconstrained-optimization

Keywords from Contributors

fluxes the-human-brain graphics julialang literate-programming scientific-reports pde simulations ode geometry
Last synced: 4 months ago · JSON representation ·

Repository

Optimization functions for Julia

Basic Info
Statistics
  • Stars: 1,171
  • Watchers: 30
  • Forks: 234
  • Open Issues: 105
  • Releases: 85
Topics
julia optim optimisation optimization unconstrained-optimisation unconstrained-optimization
Created over 13 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

Optim.jl

Build Status Codecov branch JOSS

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 = 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: JuliaNLSolvers
  • Login: JuliaNLSolvers
  • Kind: organization

JOSS Publication

Optim: A mathematical optimization package for Julia
Published
April 05, 2018
Volume 3, Issue 24, Page 615
Authors
Patrick K. Mogensen ORCID
University of Copenhagen
Asbjørn N. Riseth ORCID
University of Oxford
Editor
Lorena A Barba ORCID
Tags
Optimization

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
  • Create event: 36
  • Commit comment event: 11
  • Release event: 7
  • Issues event: 46
  • Watch event: 57
  • Delete event: 15
  • Issue comment event: 233
  • Push event: 122
  • Pull request review event: 23
  • Pull request review comment event: 26
  • Pull request event: 97
  • Fork event: 16
Last Year
  • Create event: 36
  • Commit comment event: 11
  • Release event: 7
  • Issues event: 46
  • Watch event: 57
  • Delete event: 15
  • Issue comment event: 233
  • Push event: 122
  • Pull request review event: 23
  • Pull request review comment event: 26
  • Pull request event: 97
  • Fork event: 16

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 889
  • Total Committers: 122
  • Avg Commits per committer: 7.287
  • Development Distribution Score (DDS): 0.557
Past Year
  • Commits: 47
  • Committers: 15
  • Avg Commits per committer: 3.133
  • Development Distribution Score (DDS): 0.489
Top Committers
Name Email Commits
Patrick Kofod Mogensen p****n@g****m 394
John Myles White j****w@j****m 120
Asbjørn Nilsen Riseth a****h@g****m 68
timholy t****y@g****m 40
Christof Stocker c****r@h****g 17
Asbjørn Nilsen Riseth r****h@m****k 13
Miles Lubin m****n@g****m 13
github-actions[bot] 4****] 10
Andreas Noack a****n@g****m 9
Antoine Levitt a****t@g****m 8
Christoph Ortner c****0@g****m 7
Benoît Legat b****t@g****m 6
Blake Johnson b****4@g****m 6
Christopher Rackauckas C****t@C****m 5
Kristoffer Carlsson k****n@c****e 5
Yichao Yu y****2@g****m 5
dependabot[bot] 4****] 5
Josua Grawitter j****h@g****g 4
Arno Strouwen a****n@t****e 4
Dahua Lin l****a@g****m 4
Ben Kuhn b****n@g****m 3
David Widmann d****n 3
Jeffrey Regier j****r 3
Jorge Fernandez-de-Cossio-Diaz c****o 3
femtocleaner[bot] f****] 3
abhro 5****o 3
Thomas R. Covert t****c@a****u 3
Ron Rock r****k@u****u 3
Michael Creel m****l@u****t 3
Alexey Stukalov a****t 3
and 92 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 141
  • Total pull requests: 171
  • Average time to close issues: 7 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 103
  • Total pull request authors: 45
  • Average comments per issue: 2.72
  • Average comments per pull request: 3.4
  • Merged pull requests: 120
  • Bot issues: 0
  • Bot pull requests: 20
Past Year
  • Issues: 31
  • Pull requests: 89
  • Average time to close issues: 3 days
  • Average time to close pull requests: 13 days
  • Issue authors: 18
  • Pull request authors: 17
  • Average comments per issue: 0.48
  • Average comments per pull request: 2.63
  • Merged pull requests: 60
  • Bot issues: 0
  • Bot pull requests: 11
Top Authors
Issue Authors
  • pkofod (13)
  • renatobellotti (6)
  • cseveren (4)
  • andreasnoack (3)
  • mahaa2 (3)
  • Moelf (3)
  • blegat (2)
  • sgaure (2)
  • roflmaostc (2)
  • Li-shiyue (2)
  • dhathri-auburn (2)
  • rsenne (2)
  • ForceBru (2)
  • KronosTheLate (2)
  • kbarros (2)
Pull Request Authors
  • pkofod (58)
  • dependabot[bot] (12)
  • abhro (8)
  • github-actions[bot] (7)
  • timholy (6)
  • blegat (6)
  • odow (5)
  • devmotion (5)
  • MilesCranmer (4)
  • ArnoStrouwen (4)
  • gdalle (4)
  • JoshuaLampert (2)
  • christianhauschel (2)
  • gwater (2)
  • thchr (2)
Top Labels
Issue Labels
bug (2) BREAKING (2) needs input (1) enhancement (1) trace (1)
Pull Request Labels
dependencies (12) github_actions (7) needs docs (2) needs tests (2)

Packages

  • Total packages: 3
  • Total downloads:
    • julia 10,141 total
  • Total dependent packages: 292
    (may contain duplicates)
  • Total dependent repositories: 150
    (may contain duplicates)
  • Total versions: 249
juliahub.com: Optim

Optimization functions for Julia

  • Versions: 59
  • Dependent Packages: 292
  • Dependent Repositories: 150
  • Downloads: 10,141 Total
Rankings
Forks count: 0.2%
Dependent packages count: 0.3%
Dependent repos count: 0.3%
Average: 0.3%
Stargazers count: 0.4%
Last synced: 4 months ago
proxy.golang.org: github.com/julianlsolvers/optim.jl
  • Versions: 95
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.6%
Average: 5.8%
Dependent repos count: 5.9%
Last synced: 4 months ago
proxy.golang.org: github.com/JuliaNLSolvers/Optim.jl
  • Versions: 95
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.6%
Average: 5.8%
Dependent repos count: 5.9%
Last synced: 4 months ago

Dependencies

.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/linux.yml actions
  • 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
.github/workflows/linux_nightly.yml actions
  • 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
.github/workflows/mac.yml actions
  • 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
.github/workflows/mac_nightly.yml actions
  • 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
.github/workflows/windows.yml actions
  • 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
.github/workflows/windows_nightly.yml actions
  • 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
.github/workflows/CompatHelper.yml actions