Skip to content

Commit bafc583

Browse files
committed
Merge branch 'master' into alloc2
2 parents 47ca094 + 6a8d6de commit bafc583

51 files changed

Lines changed: 1000 additions & 73 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ The file was started with Version `0.4`.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [0.5.22] September 09, 2025
10+
11+
### Added
12+
13+
* a `keywords_accepted(f, mode=:warn; kwargs...)` function that verifies that all keywords are accepted by a certain function.
14+
* an internal function `calls_with_kwargs(f)` to indicate which functions `f` passes `kwargs...` to.
15+
* a `KeywordsErrorMode` preference parameter to control how keywords that are not used/allowed should be treated. Values are `"none"`, `"warn"` (default), and `"error"`.
16+
* Add Distance over Gradients (RDoG) stepsize: `DistanceOverGradientsStepsize` and factory `DistanceOverGradients`, a learning‑rate‑free, curvature‑aware stepsize with `show`/`repr` and tests on Euclidean, Sphere, and Hyperbolic manifolds.
17+
18+
### Fixed
19+
* the typo in the name `AdaptiveRgularizationWithCubicsModelObjective` is fixed to `AdaptiveRegularizationWithCubicsModelObjective`.
20+
921
## [0.5.21] September 5, 2025
1022

1123
### Added
1224

25+
* a system to track keywords, warning when unused ones are passed and a static way to explore possible keywords.
1326
* a `warm_start_factor` field to `ProximalGradientMethodBacktrackingStepsize` to allow to scale the stepsize in the backtracking procedure.
1427
* a `gradient=` keyword in several `Stepsize`s, such that one can avoid to internally avoid computing the gradient again.
1528
* used the ``gradient=` keyword in

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Manopt"
22
uuid = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
33
authors = ["Ronny Bergmann <manopt@ronnybergmann.net>"]
4-
version = "0.5.21"
4+
version = "0.5.22"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"

docs/src/plans/index.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,30 @@ You can further activate a “Tutorial” mode by `set_parameter!(:Mode, "Tutori
5858
Manopt.is_tutorial_mode
5959
```
6060

61-
# A factory for providing manifold defaults
61+
## A factory for providing manifold defaults
6262

6363
In several cases a manifold might not yet be known at the time a (keyword) argument should be provided. Therefore, any type with a manifold default can be wrapped into a factory.
6464

6565
```@docs
6666
Manopt.ManifoldDefaultsFactory
6767
Manopt._produce_type
68+
```
69+
70+
## Keyword arguments and their verification
71+
72+
Internally `Manopt.jl` passes keywords for the (high-level) solver
73+
functions to several inner functions, e.g. to add debug or caching.
74+
Besides the documentation, one can check with the internal function [`Manopt.accepted_keywords`](@ref) which keywords a solver accepts.
75+
76+
A solver also warns, if a keyword is passed, that is not handled by the
77+
solver or any of the inner functions it calls.
78+
79+
```@docs
80+
Manopt.Keywords
81+
Manopt.accepted_keywords
82+
Manopt.ManoptKeywordError
83+
Manopt.add!
84+
Manopt.calls_with_kwargs
85+
Manopt.direct_keywords
86+
Manopt.keywords_accepted
6887
```

docs/src/plans/stepsize.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ AdaptiveWNGradient
2424
ArmijoLinesearch
2525
ConstantLength
2626
DecreasingLength
27+
DistanceOverGradients
2728
NonmonotoneLinesearch
2829
Polyak
2930
WolfePowellLinesearch
@@ -45,7 +46,7 @@ Modules = [Manopt]
4546
Pages = ["plans/stepsize.jl"]
4647
Private = true
4748
Order = [:function, :type]
48-
Filter = t -> !(t in [Stepsize, AdaptiveWNGradient, ArmijoLinesearch, ConstantLength, DecreasingLength, NonmonotoneLinesearch, Polyak, WolfePowellLinesearch, WolfePowellBinaryLinesearch ])
49+
Filter = t -> !(t in [Stepsize, AdaptiveWNGradient, ArmijoLinesearch, ConstantLength, DecreasingLength, DistanceOverGradients, NonmonotoneLinesearch, Polyak, WolfePowellLinesearch, WolfePowellBinaryLinesearch ])
4950
```
5051

5152

docs/src/references.bib

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
% --- A
66
%
77
%
8+
89
@book{AbsilMahonySepulchre:2008,
910
AUTHOR = {Absil, P.-A. and Mahony, R. and Sepulchre, R.},
1011
DOI = {10.1515/9781400830244},
@@ -287,6 +288,7 @@ @techreport{deCasteljau:1963
287288
YEAR = {1963}
288289
}
289290

291+
290292
@article{ChambollePock:2011,
291293
AUTHOR = {Chambolle, Antonin and Pock, Thomas},
292294
YEAR = {2011},
@@ -337,6 +339,7 @@ @article{DaiYuan:1999
337339
VOLUME = {10},
338340
YEAR = {1999}
339341
}
342+
340343
@article{DiepeveenLellmann:2021,
341344
AUTHOR = {Willem Diepeveen and Jan Lellmann},
342345
DOI = {10.1137/21m1398513},
@@ -351,13 +354,22 @@ @article{DiepeveenLellmann:2021
351354
VOLUME = {14},
352355
YEAR = {2021},
353356
}
357+
358+
@article{DoddSharrockNemeth:2024,
359+
title={Learning-rate-free stochastic optimization over Riemannian manifolds},
360+
author={Dodd, Daniel and Sharrock, Louis and Nemeth, Christopher},
361+
journal={arXiv preprint arXiv:2406.02296},
362+
year={2024}
363+
}
364+
354365
@techreport{Dreisigmeyer:2007,
355366
AUTHOR = {Dreisigmeyer, David W.},
356367
INSTITUTION = {Optimization Online},
357368
TITLE = {Direct Search Alogirthms over Riemannian Manifolds},
358369
URL = {https://optimization-online.org/?p=9134},
359370
YEAR = {2007}
360371
}
372+
361373
@article{DuranMoelleSbertCremers:2016,
362374
AUTHOR = {Duran, J. and Moeller, M. and Sbert, C. and Cremers, D.},
363375
TITLE = {Collaborative Total Variation: A General Framework for Vectorial TV Models},

docs/src/solvers/adaptive-regularization-with-cubics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Manopt.LanczosState
3232
There is a generic objective, that implements the sub problem
3333

3434
```@docs
35-
AdaptiveRagularizationWithCubicsModelObjective
35+
AdaptiveRegularizationWithCubicsModelObjective
3636
```
3737

3838
Since the sub problem is given on the tangent space, you have to provide
3939

4040
```
41-
arc_obj = AdaptiveRagularizationWithCubicsModelObjective(mho, σ)
41+
arc_obj = AdaptiveRegularizationWithCubicsModelObjective(mho, σ)
4242
sub_problem = DefaultProblem(TangentSpaceAt(M,p), arc_obj)
4343
```
4444

ext/ManoptRecursiveArrayToolsExt.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ end
8080
function alternating_gradient_descent(
8181
M::ProductManifold, ago::ManifoldAlternatingGradientObjective, p; kwargs...
8282
)
83+
Manopt.keywords_accepted(alternating_gradient_descent; kwargs...)
8384
q = copy(M, p)
8485
return alternating_gradient_descent!(M, ago, q; kwargs...)
8586
end
@@ -110,6 +111,7 @@ function alternating_gradient_descent!(
110111
retraction_method::AbstractRetractionMethod = default_retraction_method(M, typeof(p)),
111112
kwargs...,
112113
)
114+
Manopt.keywords_accepted(alternating_gradient_descent!; kwargs...)
113115
dagmo = Manopt.decorate_objective!(M, agmo; kwargs...)
114116
dmp = DefaultManoptProblem(M, dagmo)
115117
agds = AlternatingGradientDescentState(

src/Manopt.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ include("solvers/conjugate_gradient_descent.jl")
194194
include("solvers/conjugate_residual.jl")
195195
include("solvers/cyclic_proximal_point.jl")
196196
include("solvers/difference_of_convex_algorithm.jl")
197-
include("solvers/difference-of-convex-proximal-point.jl")
197+
include("solvers/difference_of_convex_proximal_point.jl")
198198
include("solvers/DouglasRachford.jl")
199199
include("solvers/exact_penalty_method.jl")
200200
include("solvers/projected_gradient_method.jl")
@@ -448,6 +448,7 @@ export NeverRestart, RestartOnNonDescent, RestartOnNonSufficientDescent
448448
#
449449
# Solvers
450450
export adaptive_regularization_with_cubics,
451+
accepted_keywords,
451452
adaptive_regularization_with_cubics!,
452453
alternating_gradient_descent,
453454
alternating_gradient_descent!,
@@ -516,13 +517,14 @@ export solve!
516517
export ApproxHessianFiniteDifference, ApproxHessianSymmetricRankOne, ApproxHessianBFGS
517518
export update_hessian!, update_hessian_basis!
518519
export ExactPenaltyCost, ExactPenaltyGrad, AugmentedLagrangianCost, AugmentedLagrangianGrad
519-
export AdaptiveRagularizationWithCubicsModelObjective
520+
export AdaptiveRegularizationWithCubicsModelObjective
520521
export ExactPenaltyCost, ExactPenaltyGrad
521522
export SmoothingTechnique, LinearQuadraticHuber, LogarithmicSumOfExponentials
522523
#
523524
# Stepsize
524525
export Stepsize
525-
export AdaptiveWNGradient, ConstantLength, DecreasingLength, Polyak
526+
export AdaptiveWNGradient, ConstantLength, DecreasingLength,
527+
Polyak, DistanceOverGradients, DistanceOverGradientsStepsize
526528
export ProximalGradientMethodBacktracking
527529
export ArmijoLinesearch, Linesearch, NonmonotoneLinesearch
528530
export get_stepsize, get_initial_stepsize, get_last_stepsize

src/documentation_glossary.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ define!(:LaTeX, :bar, (letter) -> raw"\bar" * "$(letter)")
6565
define!(:LaTeX, :big, raw"\big")
6666
define!(:LaTeX, :bigl, raw"\bigl")
6767
define!(:LaTeX, :bigr, raw"\bigr")
68+
define!(:LaTeX, :biggl, raw"\biggl")
69+
define!(:LaTeX, :biggr, raw"\biggr")
6870
define!(:LaTeX, :Big, raw"\Big")
6971
define!(:LaTeX, :Bigl, raw"\Bigl")
7072
define!(:LaTeX, :Bigr, raw"\Bigr")
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@doc """
2-
AdaptiveRagularizationWithCubicsModelObjective
2+
AdaptiveRegularizationWithCubicsModelObjective
33
44
A model for the adaptive regularization with Cubics
55
@@ -17,40 +17,40 @@ cf. Eq. (33) in [AgarwalBoumalBullinsCartis:2020](@cite)
1717
1818
# Constructors
1919
20-
AdaptiveRagularizationWithCubicsModelObjective(mho, σ=1.0)
20+
AdaptiveRegularizationWithCubicsModelObjective(mho, σ=1.0)
2121
2222
with either an [`AbstractManifoldHessianObjective`](@ref) `objective` or an decorator containing such an objective.
2323
"""
24-
mutable struct AdaptiveRagularizationWithCubicsModelObjective{
24+
mutable struct AdaptiveRegularizationWithCubicsModelObjective{
2525
E <: AbstractEvaluationType,
2626
O <: Union{ManifoldHessianObjective, AbstractDecoratedManifoldObjective},
2727
R,
2828
} <: AbstractManifoldSubObjective{E, O}
2929
objective::O
3030
σ::R
3131
end
32-
function AdaptiveRagularizationWithCubicsModelObjective(
32+
function AdaptiveRegularizationWithCubicsModelObjective(
3333
mho::O, σ::R = 1.0
3434
) where {
3535
E, O <: Union{AbstractManifoldHessianObjective{E}, AbstractDecoratedManifoldObjective{E}}, R,
3636
}
37-
return AdaptiveRagularizationWithCubicsModelObjective{E, O, R}(mho, σ)
37+
return AdaptiveRegularizationWithCubicsModelObjective{E, O, R}(mho, σ)
3838
end
3939
function set_parameter!(
40-
f::AdaptiveRagularizationWithCubicsModelObjective,
40+
f::AdaptiveRegularizationWithCubicsModelObjective,
4141
::Union{Val{:σ}, Val{:RegularizationParameter}},
4242
σ,
4343
)
4444
f.σ = σ
4545
return f
4646
end
4747

48-
get_objective(arcmo::AdaptiveRagularizationWithCubicsModelObjective) = arcmo.objective
48+
get_objective(arcmo::AdaptiveRegularizationWithCubicsModelObjective) = arcmo.objective
4949

5050
@doc """
51-
get_cost(TpM, trmo::AdaptiveRagularizationWithCubicsModelObjective, X)
51+
get_cost(TpM, trmo::AdaptiveRegularizationWithCubicsModelObjective, X)
5252
53-
Evaluate the tangent space [`AdaptiveRagularizationWithCubicsModelObjective`](@ref)
53+
Evaluate the tangent space [`AdaptiveRegularizationWithCubicsModelObjective`](@ref)
5454
5555
```math
5656
m(X) = f(p) + ⟨$(_tex(:grad)) f(p), X ⟩_p + $(_tex(:frac, "1", "2"))$(_tex(:Hess)) f(p)[X], X⟩_p
@@ -60,7 +60,7 @@ m(X) = f(p) + ⟨$(_tex(:grad)) f(p), X ⟩_p + $(_tex(:frac, "1", "2")) ⟨$(_t
6060
at `X`, cf. Eq. (33) in [AgarwalBoumalBullinsCartis:2020](@cite).
6161
"""
6262
function get_cost(
63-
TpM::TangentSpace, arcmo::AdaptiveRagularizationWithCubicsModelObjective, X
63+
TpM::TangentSpace, arcmo::AdaptiveRegularizationWithCubicsModelObjective, X
6464
)
6565
M = base_manifold(TpM)
6666
p = TpM.point
@@ -69,13 +69,13 @@ function get_cost(
6969
Y = get_objective_hessian(M, arcmo, p, X)
7070
return c + inner(M, p, G, X) + 1 / 2 * inner(M, p, Y, X) + arcmo.σ / 3 * norm(M, p, X)^3
7171
end
72-
function get_cost_function(arcmo::AdaptiveRagularizationWithCubicsModelObjective)
72+
function get_cost_function(arcmo::AdaptiveRegularizationWithCubicsModelObjective)
7373
return (TpM, X) -> get_cost(TpM, arcmo, X)
7474
end
7575
@doc """
76-
get_gradient(TpM, trmo::AdaptiveRagularizationWithCubicsModelObjective, X)
76+
get_gradient(TpM, trmo::AdaptiveRegularizationWithCubicsModelObjective, X)
7777
78-
Evaluate the gradient of the [`AdaptiveRagularizationWithCubicsModelObjective`](@ref)
78+
Evaluate the gradient of the [`AdaptiveRegularizationWithCubicsModelObjective`](@ref)
7979
8080
```math
8181
$(_tex(:grad)) m(X) = $(_tex(:grad)) f(p) + $(_tex(:Hess)) f(p)[X]
@@ -85,22 +85,22 @@ $(_tex(:grad)) m(X) = $(_tex(:grad)) f(p) + $(_tex(:Hess)) f(p)[X]
8585
at `X`, cf. Eq. (37) in [AgarwalBoumalBullinsCartis:2020](@cite).
8686
"""
8787
function get_gradient(
88-
TpM::TangentSpace, arcmo::AdaptiveRagularizationWithCubicsModelObjective, X
88+
TpM::TangentSpace, arcmo::AdaptiveRegularizationWithCubicsModelObjective, X
8989
)
9090
M = base_manifold(TpM)
9191
p = TpM.point
9292
G = get_objective_gradient(M, arcmo, p)
9393
return G + get_objective_hessian(M, arcmo, p, X) + arcmo.σ * norm(M, p, X) * X
9494
end
9595
function get_gradient!(
96-
TpM::TangentSpace, Y, arcmo::AdaptiveRagularizationWithCubicsModelObjective, X
96+
TpM::TangentSpace, Y, arcmo::AdaptiveRegularizationWithCubicsModelObjective, X
9797
)
9898
M = base_manifold(TpM)
9999
p = TpM.point
100100
get_objective_hessian!(M, Y, arcmo, p, X)
101101
Y .= Y + get_objective_gradient(M, arcmo, p) + arcmo.σ * norm(M, p, X) * X
102102
return Y
103103
end
104-
function get_gradient_function(arcmo::AdaptiveRagularizationWithCubicsModelObjective)
104+
function get_gradient_function(arcmo::AdaptiveRegularizationWithCubicsModelObjective)
105105
return (TpM, X) -> get_gradient(TpM, arcmo, X)
106106
end

0 commit comments

Comments
 (0)