-
Notifications
You must be signed in to change notification settings - Fork 0
/
playground.jl
31 lines (29 loc) · 846 Bytes
/
playground.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Pkg
Pkg.activate(@__DIR__)
import MultiobjectiveNonlinearCG as M
#%%
f1(x) = sum((x .- 1).^2)
f2(x) = sum((x .+ 1).^2)
df1(x) = 2 .* (x .- 1)
df2(x) = 2 .* (x .+ 1)
f(x) = vcat(f1(x), f2(x))
DfT(x) = hcat(df1(x), df2(x))
x0 = [1, 2, 3]
#%%
#descent_rule = M.SteepestDescentRule(M.StandardArmijoRule())
descent_rule = M.PRP(;
#stepsize_rule=M.StandardArmijoRule(),
stepsize_rule=M.ModifiedArmijoRule(),
criticality_measure=:cg
)
descent_rule = M.PRPGradProjection()
#descent_rule = M.PRP(M.ModifiedArmijoRule())
#descent_rule = M.SteepestDescentRule(M.FixedStepsizeRule(0.1))
M.optimize(x0, f, DfT; descent_rule)
#%%
#=
xtolrel = M.RelativeStoppingX(; eps=-1)
fxtolrel = M.RelativeStoppingFx(; eps=0.1)
critstop = M.CriticalityStop(; eps_crit = 1)
M.optimize(x0, fx0, objf!, jacT!;descent_rule, stopping_criteria=[critstop])
=#