Skip to content

Commit 0782439

Browse files
committed
Added online optimization tutorial+example, moved tutorials to an outer folder, updated project.toml to latest versions of the packages
1 parent 581e450 commit 0782439

19 files changed

+1078
-23
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.minted
2+
*.gz
3+
*.aux
4+
*.listing
5+
*.log

Manifest.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.12.0"
3+
julia_version = "1.12.2"
44
manifest_format = "2.0"
55
project_hash = "1f0c6c59d478b4871cf7367edd9839c140f2da18"
66

@@ -36,9 +36,9 @@ version = "1.0.9+0"
3636

3737
[[deps.COPT]]
3838
deps = ["LazyArtifacts", "Libdl", "LinearAlgebra", "MathOptInterface", "Pkg", "Random", "SparseArrays"]
39-
git-tree-sha1 = "9ebf6731777c6eb8e1beafc8d2803391cf77f619"
39+
git-tree-sha1 = "d155cf351bddde7f875f1f52688c159c4087d4a3"
4040
uuid = "227a2e2d-e949-4d8e-a1da-7384fe6f0b9f"
41-
version = "1.1.29"
41+
version = "1.1.30"
4242

4343
[[deps.Clarabel]]
4444
deps = ["AMD", "DataStructures", "GenericLinearAlgebra", "JSON", "LinearAlgebra", "MathOptInterface", "Printf", "QDLDL", "SnoopPrecompile", "SparseArrays", "StaticArrays", "SuiteSparse", "TOML", "TimerOutputs"]
@@ -56,9 +56,9 @@ version = "0.11.0"
5656

5757
[[deps.CodeTracking]]
5858
deps = ["InteractiveUtils", "UUIDs"]
59-
git-tree-sha1 = "9ce926a33a8608421a4d45c012884165b3fcd3ee"
59+
git-tree-sha1 = "b7231a755812695b8046e8471ddc34c8268cbad5"
6060
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
61-
version = "2.0.2"
61+
version = "3.0.0"
6262

6363
[[deps.CodecBzip2]]
6464
deps = ["Bzip2_jll", "TranscodingStreams"]
@@ -129,7 +129,7 @@ version = "0.9.5"
129129
[[deps.Downloads]]
130130
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
131131
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
132-
version = "1.6.0"
132+
version = "1.7.0"
133133

134134
[[deps.ExprTools]]
135135
git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec"
@@ -210,9 +210,9 @@ version = "1.29.3"
210210

211211
[[deps.JuliaInterpreter]]
212212
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
213-
git-tree-sha1 = "b6c76964c65ebf8309460fb8f0f437b4a59d809b"
213+
git-tree-sha1 = "80580012d4ed5a3e8b18c7cd86cebe4b816d17a6"
214214
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
215-
version = "0.10.7"
215+
version = "0.10.9"
216216

217217
[[deps.JuliaSyntaxHighlighting]]
218218
deps = ["StyledStrings"]
@@ -232,7 +232,7 @@ version = "0.6.4"
232232
[[deps.LibCURL_jll]]
233233
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "OpenSSL_jll", "Zlib_jll", "nghttp2_jll"]
234234
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
235-
version = "8.11.1+1"
235+
version = "8.15.0+0"
236236

237237
[[deps.LibGit2]]
238238
deps = ["LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
@@ -286,9 +286,9 @@ version = "1.11.0"
286286

287287
[[deps.LoweredCodeUtils]]
288288
deps = ["CodeTracking", "Compiler", "JuliaInterpreter"]
289-
git-tree-sha1 = "e24491cb83551e44a69b9106c50666dea9d953ab"
289+
git-tree-sha1 = "65ae3db6ab0e5b1b5f217043c558d9d1d33cc88d"
290290
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
291-
version = "3.4.4"
291+
version = "3.5.0"
292292

293293
[[deps.MacroTools]]
294294
git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522"
@@ -301,10 +301,10 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
301301
version = "1.11.0"
302302

303303
[[deps.MathOptInterface]]
304-
deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON3", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test"]
305-
git-tree-sha1 = "a2cbab4256690aee457d136752c404e001f27768"
304+
deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "ForwardDiff", "JSON3", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test"]
305+
git-tree-sha1 = "181c2611c7aa6a362fdf937b1e2af55e6691181f"
306306
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
307-
version = "1.46.0"
307+
version = "1.48.0"
308308

309309
[[deps.Mmap]]
310310
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
@@ -366,7 +366,7 @@ version = "0.8.7+0"
366366
[[deps.OpenSSL_jll]]
367367
deps = ["Artifacts", "Libdl"]
368368
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
369-
version = "3.5.1+0"
369+
version = "3.5.4+0"
370370

371371
[[deps.OpenSpecFun_jll]]
372372
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"]
@@ -380,7 +380,7 @@ uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
380380
version = "1.8.1"
381381

382382
[[deps.PEPit]]
383-
deps = ["Clarabel", "JuMP", "LinearAlgebra", "Literate", "Mosek", "MosekTools", "OffsetArrays", "OrderedCollections", "Revise"]
383+
deps = ["COPT", "Clarabel", "JuMP", "LinearAlgebra", "Literate", "Mosek", "MosekTools", "OffsetArrays", "OrderedCollections", "Revise"]
384384
path = "."
385385
uuid = "362dabbc-d565-4ef8-96fa-aefabe1c072a"
386386
version = "1.0.0-DEV"
@@ -446,9 +446,9 @@ version = "1.3.1"
446446

447447
[[deps.Revise]]
448448
deps = ["CodeTracking", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "REPL", "Requires", "UUIDs", "Unicode"]
449-
git-tree-sha1 = "f0da88fc9f0825bba02a6edc28df68f22060c4c7"
449+
git-tree-sha1 = "ff0bd131abc4ebd9b66d2033144bed6d011d5074"
450450
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
451-
version = "3.12.2"
451+
version = "3.12.3"
452452

453453
[deps.Revise.extensions]
454454
DistributedExt = "Distributed"
@@ -588,14 +588,14 @@ version = "1.3.1+2"
588588
[[deps.libblastrampoline_jll]]
589589
deps = ["Artifacts", "Libdl"]
590590
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
591-
version = "5.13.1+1"
591+
version = "5.15.0+0"
592592

593593
[[deps.nghttp2_jll]]
594594
deps = ["Artifacts", "Libdl"]
595595
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
596596
version = "1.64.0+1"
597597

598598
[[deps.p7zip_jll]]
599-
deps = ["Artifacts", "Libdl"]
599+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
600600
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
601-
version = "17.5.0+2"
601+
version = "17.7.0+0"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using PEPit, OrderedCollections
2+
3+
function wc_online_gradient_descent(M::Real, D::Real, n::Int; verbose = true)
4+
5+
problem = PEP()
6+
7+
gamma = D / (M * sqrt(n))
8+
9+
fis = [declare_function!(problem, ConvexLipschitzFunction, OrderedDict("M" => M)) for _ in 1:n]
10+
11+
h = declare_function!(problem, ConvexIndicatorFunction, OrderedDict("D" => D))
12+
13+
F = sum(fis)
14+
15+
x_ref = set_initial_point!(problem)
16+
x_ref, _, _ = proximal_step!(x_ref, h, 1)
17+
_, F_ref = oracle!(F, x_ref)
18+
19+
x = set_initial_point!(problem)
20+
x, _, _ = proximal_step!(x, h, 1)
21+
22+
f_saved = Vector{Expression}(undef, n)
23+
for i in 1:n
24+
g_i, f_i = oracle!(fis[i], x)
25+
f_saved[i] = f_i
26+
x, _, _ = proximal_step!(x - gamma * g_i, h, gamma)
27+
end
28+
29+
set_performance_metric!(problem, sum(f_saved) - F_ref)
30+
31+
pepit_tau = solve!(problem; verbose=verbose)
32+
33+
theoretical_tau = M * D * sqrt(n)
34+
35+
if verbose != -1
36+
println("*** Example file: worst-case regret of online gradient descent for fixed step-sizes ***")
37+
println("\tPEPit guarantee:\t R_n <= $(round(pepit_tau, digits=6))")
38+
println("\tTheoretical guarantee:\t R_n <= $(round(theoretical_tau, digits=6))")
39+
end
40+
41+
return pepit_tau, theoretical_tau
42+
end
43+
44+
45+
46+
M, D, n = 1.0, 0.5, 2
47+
48+
pepit_tau, theoretical_tau = wc_online_gradient_descent(M, D, n; verbose=true)
49+
50+

src/PEPit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ include("core/psd_matrix.jl")
3939
include("core/function.jl")
4040

4141
include("functions/convex_function.jl")
42+
include("functions/convex_lipschitz_function.jl")
4243
include("functions/smooth_function.jl")
4344
include("functions/smooth_convex_function.jl")
4445
include("functions/smooth_strongly_convex_function.jl")
@@ -62,11 +63,10 @@ include("primitive_steps/proximal_step.jl")
6263
include("primitive_steps/linear_optimization_step.jl")
6364
include("primitive_steps/shifted_optimization_step.jl")
6465

65-
6666
export
6767
PEP, Point, Expression, Constraint, PSDMatrix,
6868
AbstractFunction, PEPFunction,
69-
ConvexFunction, SmoothFunction, SmoothConvexFunction, SmoothStronglyConvexFunction, StronglyConvexFunction, ConvexIndicatorFunction,
69+
ConvexFunction, ConvexLipschitzFunction, SmoothFunction, SmoothConvexFunction, SmoothStronglyConvexFunction, StronglyConvexFunction, ConvexIndicatorFunction,
7070
LipschitzOperator, LinearOperator, NonexpansiveOperator, MonotoneOperator,
7171
solve!, declare_function!, set_initial_point!, set_initial_condition!,
7272
set_performance_metric!, add_constraint!, add_psd_matrix!,

examples/tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.ipynb renamed to tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.ipynb

File renamed without changes.

examples/tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.jl renamed to tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.jl

File renamed without changes.

examples/tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.md renamed to tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.md

File renamed without changes.

examples/tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.pdf renamed to tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.pdf

File renamed without changes.

examples/tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.tex renamed to tutorials/monotone_inclusions_variational_inequalities/accelerated_proximal_point.tutorial.tex

File renamed without changes.

0 commit comments

Comments
 (0)