Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ManifoldDiff.jl compat to 0.4 and CI #23

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- uses: actions/checkout@v3
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.3.361"
version: "1.6.39"
- uses: julia-actions/setup-julia@latest
with:
version: "1.10"
version: "1.11"
- 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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManoptExamples"
uuid = "5b8d5e80-5788-45cb-83d6-5e8f1484217d"
authors = ["Ronny Bergmann <[email protected]>"]
version = "0.1.10"
version = "0.1.11"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -19,17 +19,17 @@ 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"
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"
Expand Down
4 changes: 2 additions & 2 deletions examples/Bezier-curves.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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) |
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
StopWhenGradientNormLess(1e-7) |
StopAfterIteration(300),
debug=[
Expand Down
14 changes: 7 additions & 7 deletions examples/Difference-of-Convex-Frank-Wolfe.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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 "),
Expand Down Expand Up @@ -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
Expand All @@ -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 "),
Expand Down
8 changes: 4 additions & 4 deletions examples/Difference-of-Convex-Rosenbrock.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions examples/H2-Signal-TV.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -294,7 +294,7 @@ cppa_kwargs = [
]
cppa_bm_kwargs = [
:stopping_criterion => StopWhenAny(
StopAfterIteration(max_iters), StopWhenChangeLess(atol)
StopAfterIteration(max_iters), StopWhenChangeLess(Hn, atol)
),
]
```
Expand Down
4 changes: 2 additions & 2 deletions examples/H2_Square_Wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
),
)
#
Expand Down
8 changes: 4 additions & 4 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Manopt = "0.4.56, 0.5"
NamedColors = "0.2.1"
Plots = "1.38"
PythonCall = "0.9"
julia = "1.6"
julia = "1.10"
2 changes: 1 addition & 1 deletion examples/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ format:
variant: -raw_html+tex_math_dollars
wrap: preserve

jupyter: julia-1.10
jupyter: julia-1.11
Loading