Skip to content

Commit deeaea9

Browse files
Merge pull request #66 from mkg33/master
Update README.md
2 parents 3392a8e + d705c4d commit deeaea9

File tree

1 file changed

+67
-3
lines changed

1 file changed

+67
-3
lines changed

README.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ unified interface.
1212

1313
#### Note: This package is still in development. The README is currently both an active documentation and a development roadmap.
1414

15+
## Installation
16+
17+
Assuming that you already have Julia correctly installed, it suffices to import
18+
GalacticOptim.jl in the standard way:
19+
20+
```julia
21+
import Pkg; Pkg.add("GalacticOptim")
22+
```
23+
The packages relevant to the basic functionality of GalacticOptim.jl will be imported
24+
accordingly and, in most cases, you do not have to worry about the manual
25+
installation of dependencies.
26+
1527
## Examples
1628

1729
```julia
@@ -29,16 +41,68 @@ unified interface.
2941
sol = solve(prob,BBO())
3042
```
3143

44+
Note that in order to use BlackBoxOptim.jl, you will have to import the package
45+
manually if you don't have it (however, it is not necessary with Optim.jl).
46+
47+
A sample output of the first optimization task (with the `NelderMead()` algorithm)
48+
is given below:
49+
50+
```julia
51+
* Status: success
52+
53+
* Candidate solution
54+
Final objective value: 3.525527e-09
55+
56+
* Found with
57+
Algorithm: Nelder-Mead
58+
59+
* Convergence measures
60+
(Σ(yᵢ-ȳ)²)/n 1.0e-08
61+
62+
* Work counters
63+
Seconds run: 0 (vs limit Inf)
64+
Iterations: 60
65+
f(x) calls: 118
66+
```
67+
We can also explore other methods in a similar way:
68+
3269
```julia
3370
f = OptimizationFunction(rosenbrock, GalacticOptim.AutoForwardDiff())
3471
prob = OptimizationProblem(f, x0, p)
3572
sol = solve(prob,BFGS())
3673
```
74+
For instance, the above optimization task may produce the following output:
75+
76+
```julia
77+
* Status: success
78+
79+
* Candidate solution
80+
Final objective value: 7.645684e-21
81+
82+
* Found with
83+
Algorithm: BFGS
84+
85+
* Convergence measures
86+
|x - x'| = 3.48e-07 0.0e+00
87+
|x - x'|/|x'| = 3.48e-07 0.0e+00
88+
|f(x) - f(x')| = 6.91e-14 0.0e+00
89+
|f(x) - f(x')|/|f(x')| = 9.03e+06 0.0e+00
90+
|g(x)| = 2.32e-09 1.0e-08
91+
92+
* Work counters
93+
Seconds run: 0 (vs limit Inf)
94+
Iterations: 16
95+
f(x) calls: 53
96+
∇f(x) calls: 53
97+
```
3798

3899
```julia
39100
prob = OptimizationProblem(f, x0, p, lb = [-1.0,-1.0], ub = [1.0,1.0])
40101
sol = solve(prob, Fminbox(GradientDescent()))
41102
```
103+
The examples clearly demonstrate that GalacticOptim.jl provides an intuitive
104+
way of specifying optimization tasks and offers a relatively
105+
easy access to a wide range of optimization algorithms.
42106

43107
### Automatic Differentiation Choices
44108

@@ -77,8 +141,8 @@ solve(prob,alg;kwargs...)
77141

78142
Keyword arguments:
79143

80-
- `maxiters`
81-
- `abstol`
82-
- `reltol`
144+
- `maxiters` (the maximum number of iterations)
145+
- `abstol` (absolute tolerance)
146+
- `reltol` (relative tolerance)
83147

84148
Output Struct:

0 commit comments

Comments
 (0)