From 41081ada542f7e500f7f7dd4e6c36c33e8f642cd Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 18:55:16 +0100 Subject: [PATCH 1/8] Update compat and CI --- .github/dependabot.yml | 7 +++++++ .github/workflows/ci.yml | 9 +++++---- .github/workflows/documenter.yml | 10 +++++----- .github/workflows/format.yml | 2 +- Changelog.md | 8 ++++++++ Project.toml | 16 ++++++++-------- 6 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..700707c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48eb8ec..1a0ab7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,19 +11,20 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: ["1.6", "1.10", "1.11"] + julia-version: ["lts", "1", "pre"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} arch: x64 - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: julia-actions/julia-processcoverage@latest + - uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} file: ./lcov.info name: codecov-umbrella fail_ci_if_error: false diff --git a/.github/workflows/documenter.yml b/.github/workflows/documenter.yml index 9c7d634..212ea00 100644 --- a/.github/workflows/documenter.yml +++ b/.github/workflows/documenter.yml @@ -13,15 +13,15 @@ jobs: - uses: actions/checkout@v3 - uses: quarto-dev/quarto-actions/setup@v2 with: - version: "1.3.361" + version: "1.6.38" - uses: julia-actions/setup-julia@latest with: version: "1.10" - name: Julia Cache - uses: julia-actions/cache@v1 + uses: julia-actions/cache@v2 - name: Cache Quarto id: cache-quarto - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-quarto with: @@ -31,7 +31,7 @@ jobs: ${{ runner.os }}-${{ env.cache-name }}- - name: Cache Documenter id: cache-documenter - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-documenter with: @@ -41,7 +41,7 @@ jobs: ${{ runner.os }}-${{ env.cache-name }}- - name: Cache CondaPkg id: cache-condaPkg - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-condapkg with: diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 3c22989..99ef4a6 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: 1 - name: Install JuliaFormatter and format diff --git a/Changelog.md b/Changelog.md index 408be1f..8e940bc 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,14 @@ All notable changes to this Julia package will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.11] – 16/12/2024 + +### Changed + +* Added compatibility with ManifoldDiff.jl v0.4 +* Minimum Julia version bumped to 1.10. +* CI updates + ## [0.1.10] – 18/10/2024 ### Changed diff --git a/Project.toml b/Project.toml index 0952331..a2d980a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ManoptExamples" uuid = "5b8d5e80-5788-45cb-83d6-5e8f1484217d" authors = ["Ronny Bergmann "] -version = "0.1.10" +version = "0.1.11" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -19,15 +19,15 @@ ManoptExamplesManoptExt = "Manopt" [compat] Distributions = "0.25" -LinearAlgebra = "1.6" -ManifoldDiff = "0.3" -Manifolds = "0.9, 0.10" +LinearAlgebra = "1.10" +ManifoldDiff = "0.4" +Manifolds = "0.10" ManifoldsBase = "0.15" Manopt = "0.4.7, 0.5" -Markdown = "1.6" -Random = "1.6" -Test = "1.6" -julia = "1.6" +Markdown = "1.10" +Random = "1.10" +Test = "1.10" +julia = "1.10" RecursiveArrayTools = "2, 3" Requires = "0.5, 1" From b09cf68f98ddbe015f2a5aabe099657dd37c5251 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 19:13:09 +0100 Subject: [PATCH 2/8] one more bump --- examples/Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Project.toml b/examples/Project.toml index 75c1acd..7d4c044 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -22,11 +22,11 @@ Colors = "0.12" IJulia = "1" LRUCache = "1.4" LineSearches = "7" -ManifoldDiff = "0.3.9" -Manifolds = "0.9, 0.10" +ManifoldDiff = "0.4" +Manifolds = "0.10" ManifoldsBase = "0.15" Manopt = "0.4.56" NamedColors = "0.2.1" Plots = "1.38" PythonCall = "0.9" -julia = "1.6" +julia = "1.10" From 6a7cbb1d1a62d5c3b9e01b11f442f8f60aa3f181 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 19:20:23 +0100 Subject: [PATCH 3/8] bumps --- Project.toml | 4 ++-- examples/Project.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index a2d980a..a33548e 100644 --- a/Project.toml +++ b/Project.toml @@ -23,13 +23,13 @@ LinearAlgebra = "1.10" ManifoldDiff = "0.4" Manifolds = "0.10" ManifoldsBase = "0.15" -Manopt = "0.4.7, 0.5" +Manopt = "0.5" Markdown = "1.10" Random = "1.10" Test = "1.10" julia = "1.10" RecursiveArrayTools = "2, 3" -Requires = "0.5, 1" +Requires = "1" [extras] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/examples/Project.toml b/examples/Project.toml index 7d4c044..9e13ffc 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -25,7 +25,7 @@ LineSearches = "7" ManifoldDiff = "0.4" Manifolds = "0.10" ManifoldsBase = "0.15" -Manopt = "0.4.56" +Manopt = "0.4.56, 0.5" NamedColors = "0.2.1" Plots = "1.38" PythonCall = "0.9" From 047cd500cf8262567d6cda22f547f181d9b9dda0 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 19:31:39 +0100 Subject: [PATCH 4/8] trying to fix bezier --- examples/Bezier-curves.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Bezier-curves.qmd b/examples/Bezier-curves.qmd index 408f985..292ef7e 100644 --- a/examples/Bezier-curves.qmd +++ b/examples/Bezier-curves.qmd @@ -174,7 +174,7 @@ pB_opt = gradient_descent( contraction_factor=0.5, sufficient_decrease=0.001, ), - stopping_criterion=StopWhenChangeLess(1e-5) | + stopping_criterion=StopWhenChangeLess(N, 1e-5) | StopWhenGradientNormLess(1e-7) | StopAfterIteration(300), debug=[ From fb1d55383d9eb0e56ada47562a6d9fbd234e6637 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 21:20:13 +0100 Subject: [PATCH 5/8] fix --- examples/Bezier-curves.qmd | 2 +- examples/Difference-of-Convex-Frank-Wolfe.qmd | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Bezier-curves.qmd b/examples/Bezier-curves.qmd index 292ef7e..3bb8efe 100644 --- a/examples/Bezier-curves.qmd +++ b/examples/Bezier-curves.qmd @@ -126,7 +126,7 @@ end ``` Which is the following cure, which clearly starts and ends slower than its speed in the middle, -which can be seen by the increasing length of the gangent vectors in the middle. +which can be seen by the increasing length of the tangent vectors in the middle. ![The original curve](img/bezier/bezier-acceleration-orig.png) diff --git a/examples/Difference-of-Convex-Frank-Wolfe.qmd b/examples/Difference-of-Convex-Frank-Wolfe.qmd index e7850ff..daf5c35 100644 --- a/examples/Difference-of-Convex-Frank-Wolfe.qmd +++ b/examples/Difference-of-Convex-Frank-Wolfe.qmd @@ -6,7 +6,7 @@ date: 11/06/2023 ## Introduction -In this example we compare the Difference of Convex Algprithm (DCA) [BergmannFerreiraSantosSouza:2023](@cite) +In this example we compare the Difference of Convex Algorithm (DCA) [BergmannFerreiraSantosSouza:2023](@cite) with the Frank-Wolfe Algorithm, which was introduced in [WeberSra:2022](@cite). This example reproduces the results from [BergmannFerreiraSantosSouza:2023](@cite), Section 7.3. @@ -131,7 +131,7 @@ and $D=(d_{ij})$. @doc raw""" closed_form_solution!(M, q, L, U, p X) -Compute the closeed form solution of the constraint sub problem in place of ``q``. +Compute the closed form solution of the constraint sub problem in place of ``q``. """ function closed_form_solution!(M::SymmetricPositiveDefinite, q, L, U, p, X) # extract p^1/2 and p^{-1/2} @@ -284,7 +284,7 @@ Let's compare both methods when they have the same stopping criteria sub_problem=dc_sub_solution_safe!, evaluation=InplaceEvaluation(), stopping_criterion = StopAfterIteration(300) | - StopWhenChangeLess(1e-14) | StopWhenGradientChangeLess(M, 1e-9), + StopWhenChangeLess(M, 1e-14) | StopWhenGradientChangeLess(M, 1e-9), debug = [ (:Iteration, "# %-8d "), (:Cost, "F(p): %0.14f"), (:Change, " |Δp|: %0.14f "), (:GradientNorm, " |grad f(p)|: %0.8f "), @@ -314,7 +314,7 @@ For the statistics we extract the recordings from the state ## Define the Frank-Wolfe functions -For Frank wolfe, the cost is just defined as $-h(p)$ but the minimisation is constraint to $\mathcal C$, which is enfored by the oracle. +For Frank wolfe, the cost is just defined as $-h(p)$ but the minimisation is constraint to $\mathcal C$, which is enforced by the oracle. ```{julia} #| output: false @@ -335,7 +335,7 @@ Similarly we can run the Frank-Wolfe algorithm with sub_problem=oracle_fw!, evaluation=InplaceEvaluation(), stopping_criterion = StopAfterIteration(10^4) | - StopWhenChangeLess(1e-14) | StopWhenGradientChangeLess(M, 1e-9), + StopWhenChangeLess(M, 1e-14) | StopWhenGradientChangeLess(M, 1e-9), debug = [ (:Iteration, "# %-8d "), :Cost, (:Change, " |Δp|: %0.14f "), (:GradientNorm, " |grad f(p)|: %0.8f "), From 5f2bf3c71f5e444ce07c66a53a754647c6121eda Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 21:22:21 +0100 Subject: [PATCH 6/8] typos --- examples/Difference-of-Convex-Frank-Wolfe.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Difference-of-Convex-Frank-Wolfe.qmd b/examples/Difference-of-Convex-Frank-Wolfe.qmd index daf5c35..0cf3b55 100644 --- a/examples/Difference-of-Convex-Frank-Wolfe.qmd +++ b/examples/Difference-of-Convex-Frank-Wolfe.qmd @@ -37,7 +37,7 @@ indigo = paul_tol["mutedindigo"] teal = paul_tol["mutedteal"] ``` -We consider the collowing constraint maximimization problem of the Fréchet mean +We consider the following constraint maximization problem of the Fréchet mean on the [symmetric positive definite matrices](https://juliamanifolds.github.io/Manifolds.jl/latest/manifolds/symmetricpositivedefinite.html) $\mathcal P(n)$ with the [affine invariant metric](https://juliamanifolds.github.io/Manifolds.jl/latest/manifolds/symmetricpositivedefinite.html#Default-metric:-the-affine-invariant-metric). Let $q_1,\ldots,q_m \in \mathcal P(n)$ be a set of points and $\mu_1,\ldots,\mu_m$ be a set of weights, such that they sum to one. We consider then @@ -152,7 +152,7 @@ end ## The Difference of Convex Formulation -We use $g(p) = \iota_{\mathcal C}(p)$ as the indicator funtion of the set $\mathcal C$. We use +We use $g(p) = \iota_{\mathcal C}(p)$ as the indicator function of the set $\mathcal C$. We use ```{julia} #| output: false From 58f336d964faba416fe25c50daaad78f4e40c1fa Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Sun, 15 Dec 2024 21:57:25 +0100 Subject: [PATCH 7/8] fixes --- examples/Difference-of-Convex-Rosenbrock.qmd | 8 ++++---- examples/H2-Signal-TV.qmd | 4 ++-- examples/H2_Square_Wave.jl | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/Difference-of-Convex-Rosenbrock.qmd b/examples/Difference-of-Convex-Rosenbrock.qmd index afa79e7..f93e961 100644 --- a/examples/Difference-of-Convex-Rosenbrock.qmd +++ b/examples/Difference-of-Convex-Rosenbrock.qmd @@ -139,7 +139,7 @@ and call the [gradient descent algorithm](https://manoptjl.org/stable/solvers/gr Eucl_GD_state = gradient_descent(M, f, ∇f!!, p0; evaluation=InplaceEvaluation(), debug=[debug_vec...,10^7], - stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(1e-16), + stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(M, 1e-16), record=[:Iteration, :Cost], return_state=true, ) @@ -172,7 +172,7 @@ end R_GD_state = gradient_descent(M_rb, f, grad_f!, p0; evaluation=InplaceEvaluation(), debug=[debug_vec...,10^6], - stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(1e-16), + stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(M_rb, 1e-16), record=[:Iteration, :Cost], return_state=true, ) @@ -243,7 +243,7 @@ E_doc_state = difference_of_convex_algorithm( debug=[debug_vec..., 10^4], evaluation=InplaceEvaluation(), record=[:Iteration, :Cost], - stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(1e-16), + stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(M, 1e-16), sub_hess=nothing, # Use gradient descent sub_stopping_criterion=StopAfterIteration(2000) | StopWhenGradientNormLess(1e-16), return_state=true, @@ -370,7 +370,7 @@ R_doc_state = difference_of_convex_algorithm( debug=[debug_vec..., 10^6], evaluation=InplaceEvaluation(), record=[:Iteration, :Cost], - stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(1e-16), + stopping_criterion=StopAfterIteration(10^8) | StopWhenChangeLess(M_rb, 1e-16), sub_grad=docR_sub_grad, sub_hess = nothing, # Use gradient descent sub_stopping_criterion=StopAfterIteration(2000) | StopWhenGradientNormLess(1e-16), diff --git a/examples/H2-Signal-TV.qmd b/examples/H2-Signal-TV.qmd index e866e9c..6ae114b 100644 --- a/examples/H2-Signal-TV.qmd +++ b/examples/H2-Signal-TV.qmd @@ -275,7 +275,7 @@ sgm_bm_kwargs = [ ] cppa_kwargs = [ :stopping_criterion => StopWhenAny( - StopAfterIteration(max_iters), StopWhenChangeLess(atol) + StopAfterIteration(max_iters), StopWhenChangeLess(Hn, atol) ), :debug => [ :Iteration, @@ -294,7 +294,7 @@ cppa_kwargs = [ ] cppa_bm_kwargs = [ :stopping_criterion => StopWhenAny( - StopAfterIteration(max_iters), StopWhenChangeLess(atol) + StopAfterIteration(max_iters), StopWhenChangeLess(Hn, atol) ), ] ``` diff --git a/examples/H2_Square_Wave.jl b/examples/H2_Square_Wave.jl index a4d6941..8300665 100644 --- a/examples/H2_Square_Wave.jl +++ b/examples/H2_Square_Wave.jl @@ -240,7 +240,7 @@ c = cyclic_proximal_point( proxes, p0; stopping_criterion=StopWhenAny( - StopAfterIteration(max_iters), StopWhenChangeLess(10.0^-8) + StopAfterIteration(max_iters), StopWhenChangeLess(Hn, 10.0^-8) ), debug=[ :Iteration, @@ -327,7 +327,7 @@ if benchmarking $proxes, $p0; stopping_criterion=StopWhenAny( - StopAfterIteration($max_iters), StopWhenChangeLess(10.0^-8) + StopAfterIteration($max_iters), StopWhenChangeLess($Hn, 10.0^-8) ), ) # From 9f219f129c621092ee498bfab01f4af604229171 Mon Sep 17 00:00:00 2001 From: Ronny Bergmann Date: Mon, 16 Dec 2024 18:14:31 +0100 Subject: [PATCH 8/8] update all versions. --- .github/workflows/documenter.yml | 4 ++-- examples/_quarto.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documenter.yml b/.github/workflows/documenter.yml index 212ea00..9961711 100644 --- a/.github/workflows/documenter.yml +++ b/.github/workflows/documenter.yml @@ -13,10 +13,10 @@ jobs: - uses: actions/checkout@v3 - uses: quarto-dev/quarto-actions/setup@v2 with: - version: "1.6.38" + version: "1.6.39" - uses: julia-actions/setup-julia@latest with: - version: "1.10" + version: "1.11" - name: Julia Cache uses: julia-actions/cache@v2 - name: Cache Quarto diff --git a/examples/_quarto.yml b/examples/_quarto.yml index 9c688ca..e346f56 100644 --- a/examples/_quarto.yml +++ b/examples/_quarto.yml @@ -26,4 +26,4 @@ format: variant: -raw_html+tex_math_dollars wrap: preserve -jupyter: julia-1.10 +jupyter: julia-1.11