Skip to content

Commit

Permalink
Merge branch 'master' into kellertuer/TR-subsolver
Browse files Browse the repository at this point in the history
# Conflicts:
#	Project.toml
#	docs/Project.toml
#	docs/src/solvers/ChambollePock.md
#	ext/ManoptManifoldsExt/ARC_CG.jl
#	src/data/artificialDataFunctions.jl
  • Loading branch information
kellertuer committed Oct 25, 2023
2 parents 44fe628 + 7563b32 commit bc2b732
Show file tree
Hide file tree
Showing 16 changed files with 212 additions and 88 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check Changelog
on:
pull_request:

jobs:
Check-Changelog:
name: Check Changelog Action
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v2
with:
changelog: Changelog.md
64 changes: 63 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,68 @@ All notable Changes to the Julia package `Manopt.jl` will be documented in this
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.4.40] – 24/10/2023

### Added

* add a `--help` argument to `docs/make.jl` to document all availabel command line arguments
* add a `--exclude-tutorials` argument to `docs/make.jl`. This way, when quarto is not available
on a computer, the docs can still be build with the tutorials not being added to the menu
such that documenter does not expect them to exist.

### Changes

* Bump dependencies to `ManifoldsBase.jl` 0.15 and `Manifolds.jl` 0.9
* move the ARC CG subsolver to the main package, since `TangentSpace` is now already
available from `ManifoldsBase`.

## [0.4.39] – 09/10/2023

### Changes

* also use the pair of a retraction and the inverse retraction (see last update)
to perform the relaxation within the Douglas-Rachford algorithm.

## [0.4.38] – 08/10/2023

### Changes

* avoid allocations when calling `get_jacobian!` within the Levenberg-Marquard Algorithm.

### Fixed

* Fix a lot of typos in the documentation

## [0.4.37] – 28/09/2023

### Changes

* add more of the Riemannian Levenberg-Marquard algorithms parameters as keywords, so they
can be changed on call
* generalize the internal reflection of Douglas-Rachford, such that is also works with an
arbitrary pair of a reflection and an inverse reflection.

## [0.4.36] – 20/09/2023

### Fixed

* Fixed a bug that caused non-matrix points and vectors to fail when working with approcimate

## [0.4.35] – 14/09/2023

### Added

* The access to functions of the objective is now unified and encapsulated in proper `get_`
functions.

## [0.4.34] – 02/09/2023

### Added

* an `ManifoldEuclideanGradientObjetive` to allow the cost, gradient, and Hessian and other
first or second derivative based elements to be Euclidean and converted when needed.
* a keyword `objective_type=:Euclidean` for all solvers, that specifies that an Objective shall be created of the above type

## [0.4.33] - 24/08/2023

### Added
Expand Down Expand Up @@ -282,7 +344,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* a `max_stepsize` per manifold to avoid leaving the injectivity radius,
which it also defaults to

## {0.4.0] - 10/01/2023
## [0.4.0] - 10/01/2023

### Added

Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manopt"
uuid = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
authors = ["Ronny Bergmann <[email protected]>"]
version = "0.4.39"
version = "0.4.40"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down Expand Up @@ -41,7 +41,7 @@ DataStructures = "0.17, 0.18"
LRUCache = "1.4"
ManifoldDiff = "0.3.8"
Manifolds = "0.9"
ManifoldsBase = "0.14.10, 0.15.0"
ManifoldsBase = "0.15"
PolynomialRoots = "1"
Requires = "0.5, 1"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
BenchmarkTools = "1.3"
CondaPkg = "0.2"
Documenter = "1"
Manifolds = "0.8.75"
ManifoldsBase = "0.13, 0.14"
Manifolds = "0.8.81, 0.9"
ManifoldsBase = "0.14.12, 0.15"
90 changes: 65 additions & 25 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
#
#

if "--help" ARGS
println(
"""
docs/make.jl
Render the `Manopt.jl` documenation with optinal arguments
Arguments
* `--exclude-docs` - exclude the tutorials from the menu of Documenter,
this can be used if you do not have Quarto installed to still be able to render the docs
locally on this machine. This option should not be set on CI.
* `--help` - print this help and exit without rendering the documentation
* `--quarto` – run the Quarto notebooks from the `tutorials/` folder before generating the documentation
this has to be run locally at least once for the `tutorials/*.md` files to exist that are included in
the documentation (see `--exclude-tutorials`) for the alternative.
If they are generated ones they are cached accordingly.
Then you can spare time in the rendering by not passing this argument.
""",
)
exit(0)
end

#
# (a) if docs is not the current active environment, switch to it
# (from https://github.com/JuliaIO/HDF5.jl/pull/1020/) 
Expand Down Expand Up @@ -29,6 +51,17 @@ if "--quarto" ∈ ARGS
end
end

tutorials_in_menu = true
if "--exclude-tutorials" ARGS
@warn """
You are excluding the tutorials from the Menu,
which might be done if you can not render them locally.
Remember that this should never be done on CI for the full documentation.
"""
tutorials_in_menu = false
end

# (c) load necessary packages for the docs
using Documenter
using DocumenterCitations
Expand All @@ -38,22 +71,39 @@ using LineSearches, LRUCache, Manopt, Manifolds, Plots
generated_path = joinpath(@__DIR__, "src")
base_url = "https://github.com/JuliaManifolds/Manopt.jl/blob/master/"
isdir(generated_path) || mkdir(generated_path)
open(joinpath(generated_path, "contributing.md"), "w") do io
# Point to source license file
println(
io,
"""
```@meta
EditURL = "$(base_url)CONTRIBUTING.md"
```
""",
)
# Write the contents out below the meta block
for line in eachline(joinpath(dirname(@__DIR__), "CONTRIBUTING.md"))
println(io, line)
for (md_file, doc_file) in
[("CONTRIBUTING.md", "contributing.md"), ("Changelog.md", "changelog.md")]
open(joinpath(generated_path, doc_file), "w") do io
# Point to source license file
println(
io,
"""
```@meta
EditURL = "$(base_url)$(md_file)"
```
""",
)
# Write the contents out below the meta block
for line in eachline(joinpath(dirname(@__DIR__), md_file))
println(io, line)
end
end
end

## Build titorials menu
tutorials_menu =
"How to..." => [
"Get started: Optimize!" => "tutorials/Optimize!.md",
"Speedup using Inplace computations" => "tutorials/InplaceGradient.md",
"Use Automatic Differentiation" => "tutorials/AutomaticDifferentiation.md",
"Define Objectives in the Embedding" => "tutorials/EmbeddingObjectives.md",
"Count and use a Cache" => "tutorials/CountAndCache.md",
"Print Debug Output" => "tutorials/HowToDebug.md",
"Record values" => "tutorials/HowToRecord.md",
"Implement a Solver" => "tutorials/ImplementASolver.md",
"Do Constrained Optimization" => "tutorials/ConstrainedOptimization.md",
"Do Geodesic Regression" => "tutorials/GeodesicRegression.md",
]
# (e) ...finally! make docs
bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style=:alpha)
makedocs(;
Expand Down Expand Up @@ -90,18 +140,7 @@ makedocs(;
pages=[
"Home" => "index.md",
"About" => "about.md",
"How to..." => [
"Get started: Optimize!" => "tutorials/Optimize!.md",
"Speedup using Inplace computations" => "tutorials/InplaceGradient.md",
"Use Automatic Differentiation" => "tutorials/AutomaticDifferentiation.md",
"Define Objectives in the Embedding" => "tutorials/EmbeddingObjectives.md",
"Count and use a Cache" => "tutorials/CountAndCache.md",
"Print Debug Output" => "tutorials/HowToDebug.md",
"Record values" => "tutorials/HowToRecord.md",
"Implement a Solver" => "tutorials/ImplementASolver.md",
"Do Constrained Optimization" => "tutorials/ConstrainedOptimization.md",
"Do Geodesic Regression" => "tutorials/GeodesicRegression.md",
],
(tutorials_in_menu ? [tutorials_menu] : [])...,
"Solvers" => [
"Introduction" => "solvers/index.md",
"Adaptive Regularization with Cubics" => "solvers/adaptive-regularization-with-cubics.md",
Expand Down Expand Up @@ -154,6 +193,7 @@ makedocs(;
"Contributing to Manopt.jl" => "contributing.md",
"Extensions" => "extensions.md",
"Notation" => "notation.md",
"Changelog" => "changelog.md",
"References" => "references.md",
],
plugins=[bib],
Expand Down
4 changes: 1 addition & 3 deletions docs/src/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

In this package, we follow the notation introduced in [Manifolds.jl – Notation](https://juliamanifolds.github.io/Manifolds.jl/latest/misc/notation.html)

with the following additional or slightly changed notation
with the following additional notation

| Symbol | Description | Also used | Comment |
|:--:|:--------------- |:--:|:-- |
| ```` | The [Levi-Cevita connection](https://en.wikipedia.org/wiki/Levi-Civita_connection) | | |
| ``\operatorname{grad}f`` | The Riemannian gradient | ``∇f``| due to possible confusion with the connection, we try to avoid ``∇f`` |
| ``\operatorname{Hess}f``| The Riemannian Hessian | |
3 changes: 3 additions & 0 deletions docs/src/solvers/ChambollePock.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ The Riemannian Chambolle–Pock is a generalization of the Chambolle–Pock algo
It is also known as primal-dual hybrid gradient (PDHG) or primal-dual proximal splitting (PDPS) algorithm.

In order to minimize over ``p∈\mathcal M`` the cost function consisting of
In order to minimize a cost function consisting of

```math
F(p) + G(Λ(p)),
```

over ``p∈\mathcal M``

where ``F:\mathcal M → \overline{ℝ}``, ``G:\mathcal N → \overline{ℝ}``, and
``Λ:\mathcal M →\mathcal N``.
If the manifolds ``\mathcal M`` or ``\mathcal N`` are not Hadamard, it has to be considered locally,
Expand Down
46 changes: 0 additions & 46 deletions ext/ManoptManifoldsExt/ARC_CG.jl

This file was deleted.

1 change: 0 additions & 1 deletion ext/ManoptManifoldsExt/ManoptManifoldsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ include("nonmutating_manifolds_functions.jl")
include("artificialDataFunctionsManifolds.jl")
include("ChambollePockManifolds.jl")
include("alternating_gradient.jl")
include("ARC_CG.jl")
end
2 changes: 2 additions & 0 deletions src/Manopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ using ManifoldsBase:
NestedPowerRepresentation,
ParallelTransport,
PowerManifold,
ProductManifold,
ProjectionTransport,
QRRetraction,
TangentSpace,
Expand Down Expand Up @@ -124,6 +125,7 @@ using ManifoldsBase:
set_component!,
shortest_geodesic,
shortest_geodesic!,
submanifold_components,
vector_transport_to,
vector_transport_to!,
zero_vector,
Expand Down
8 changes: 4 additions & 4 deletions src/data/artificialDataFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function artificial_S2_whirl_image end
Generate an artificial image of data on the 2 sphere,
# Arguments
* `pts` – (`64`) size of the image in `pts```\times```pts` pixel.
* `pts` – (`64`) size of the image in `pts`×`pts` pixel.
This example dataset was used in the numerical example in Section 5.5 of [Laus et al., SIAM J Imag Sci., 2017](@cite LausNikolovaPerschSteidl:2017)
Expand All @@ -172,7 +172,7 @@ artificial_S2_rotation_image()
@doc raw"""
artificial_S2_whirl_patch([pts=5])
create a whirl within the `pts```\times```pts` patch of
create a whirl within the `pts`×`pts` patch of
[Sphere](https://juliamanifolds.github.io/Manifolds.jl/stable/manifolds/sphere.html)(@ref)`(2)`-valued image data.
These patches are used within [`artificial_S2_whirl_image`](@ref).
Expand Down Expand Up @@ -237,7 +237,7 @@ artificial_S2_composite_bezier_curve()
artificial_SPD_image([pts=64, stepsize=1.5])
create an artificial image of symmetric positive definite matrices of size
`pts` ``\times```pts` pixel with a jump of size `stepsize`.
`pts`×`pts` pixel with a jump of size `stepsize`.
This dataset was used in the numerical example of Section 5.2 of [Bačák et al., SIAM J Sci Comput, 2016](@cite BacakBergmannSteidlWeinmann:2016).
"""
Expand Down Expand Up @@ -273,7 +273,7 @@ function artificial_SPD_image2 end
artificial_SPD_image2([pts=64, fraction=.66])
create an artificial image of symmetric positive definite matrices of size
`pts```\times```pts` pixel with right hand side `fraction` is moved upwards.
`pts`×`pts` pixel with right hand side `fraction` is moved upwards.
This data set was introduced in the numerical examples of Section of [Bergmann, Presch, Steidl, SIAM J Imag Sci, 2016](@cite BergmannPerschSteidl:2016)
"""
Expand Down
2 changes: 2 additions & 0 deletions src/plans/nonlinear_least_squares_plan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ mutable struct LevenbergMarquardtState{
damping_term_min::Tparams
β::Tparams
expect_zero_residual::Bool
last_step_successful::Bool
function LevenbergMarquardtState(
M::AbstractManifold,
p::P,
Expand Down Expand Up @@ -244,6 +245,7 @@ mutable struct LevenbergMarquardtState{
damping_term_min,
β,
expect_zero_residual,
true,
)
end
end
Expand Down
Loading

0 comments on commit bc2b732

Please sign in to comment.