Skip to content
Merged
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
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* add keyword argument `is_feasible_error` to `interior_point_Newton` to control how to handle infeasible starting points (#556)
* add keyword argument `at_init` to some debug options to control whether they print already at the initialisation and hence before the first iteration (#552)

### Fixed

* fixed a few typos in the documentation (#557)

## [0.5.29] November 26, 2025

### Added
Expand Down
4 changes: 2 additions & 2 deletions src/plans/quasi_newton_plan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ taking into account that the corresponding step size is chosen.

# Provided functors

* `(mp::AbstractManoptproblem, st::QuasiNewtonState) -> η` to compute the update direction
* `(η, mp::AbstractManoptproblem, st::QuasiNewtonState) -> η` to compute the update direction in-place of `η`
* `(mp::AbstractManoptProblem, st::QuasiNewtonState) -> η` to compute the update direction
* `(η, mp::AbstractManoptProblem, st::QuasiNewtonState) -> η` to compute the update direction in-place of `η`

# Fields

Expand Down
19 changes: 12 additions & 7 deletions src/plans/stopping_criterion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ any point ``p = (p_1,…,p_n) ∈ $(_math(:M))`` is a vector of length ``n`` wit
Then, denoting the `outer_norm` by ``r``, the distance of two points ``p,q ∈ $(_math(:M))``
is given by

```
```math
$(_math(:distance))(p,q) = $(_tex(:Bigl))( $(_tex(:sum))_{k=1}^n $(_math(:distance))(p_k,q_k)^r $(_tex(:Bigr)))^{$(_tex(:frac, "1", "r"))},
```

Expand Down Expand Up @@ -575,7 +575,7 @@ any point ``p = (p_1,…,p_n) ∈ $(_math(:M))`` is a vector of length ``n`` wit
Then, denoting the `outer_norm` by ``r``, the norm of the difference of tangent vectors like the last and current gradien ``X,Y ∈ $(_math(:M))``
is given by

```
```math
$(_tex(:norm, "X-Y"; index = "p")) = $(_tex(:Bigl))( $(_tex(:sum))_{k=1}^n $(_tex(:norm, "X_k-Y_k"; index = "p_k"))^r $(_tex(:Bigr)))^{$(_tex(:frac, "1", "r"))},
```

Expand Down Expand Up @@ -686,8 +686,8 @@ A stopping criterion based on the current gradient norm.
# Fields

* `norm`: a function `(M::AbstractManifold, p, X) -> ℝ` that computes a norm
of the gradient `X` in the tangent space at `p` on `M``.
For manifolds with components provide `(M::AbstractManifold, p, X, r) -> ℝ`.
of the gradient `X` in the tangent space at `p` on `M`.
For manifolds with components provide a function `(M::AbstractManifold, p, X, r) -> ℝ`.
* `threshold`: the threshold to indicate to stop when the distance is below this value
* `outer_norm`: if `M` is a manifold with components, this can be used to specify the norm,
that is used to compute the overall distance based on the element-wise distance.
Expand All @@ -704,7 +704,7 @@ any point ``p = (p_1,…,p_n) ∈ $(_math(:M))`` is a vector of length ``n`` wit
Then, denoting the `outer_norm` by ``r``, the norm of a tangent vector like the current gradient ``X ∈ $(_math(:M))``
is given by

```
```math
$(_tex(:norm, "X"; index = "p")) = $(_tex(:Bigl))( $(_tex(:sum))_{k=1}^n $(_tex(:norm, "X_k"; index = "p_k"))^r $(_tex(:Bigr)))^{$(_tex(:frac, "1", "r"))},
```

Expand Down Expand Up @@ -1301,15 +1301,17 @@ has indicated to stop for `n` (consecutive) times

Create a stopping criterion that indicates to stop when the `criterion` has indicated to stop
`n` times (consecutively, if `consecutive=true` for the first constructor).
Note that the cross product is in general noncommutative, and here only the order `sc × n`` is possible.
Note that the cross product is in general noncommutative, and here only the order `sc × n` is possible.

# Examples

A stopping criterion that indicates to stop whenever the gradient norm is less that `1e-6` for three consecutive iterations:

StopWhenRepeated(StopWhenGradientNormLess(1e-6), 3)
StopWhenGradientNormLess(1e-6) × 3

A stopping criterion that indicates to stop whenever the gradient norm is less that `1e-6` at three iterations (not necessarily consecutive):

StopWhenRepeated(StopWhenGradientNormLess(1e-6), 3; consecutive=false)
"""
mutable struct StopWhenRepeated{SC <: StoppingCriterion} <: StoppingCriterion
Expand Down Expand Up @@ -1392,7 +1394,9 @@ A stopping criterion, that only evaluates a certain (inner) stopping based on a
on the iterate `k`.
The condition is a function `condition(k) -> Bool`.

## Example `(k) -> >(n)` would only activate that stopping criterion after `n` iterations.`.
## Example

`(k) -> >(n)` would only activate that stopping criterion after `n` iterations.

## Fields

Expand All @@ -1409,6 +1413,7 @@ check the inner criterion. The `n` is ignored if you provide a manual functor `c
## Examples

A stopping criterion that indicates to stop when the gradient norm is small but only after the third iteration

StopWhenCriterionWithIterationCondition(StopWhenGradientNormLess(1e-6), 3)

You can also use the infix operators `≟` (`\\questeq` on REPL), `⩻` (`\\ltquest`), and `⩼` (`\\gtquest`) to create such a criterion:
Expand Down
2 changes: 2 additions & 0 deletions tutorials/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/.quarto/

**/*.quarto_ipynb
4 changes: 2 additions & 2 deletions tutorials/AutomaticDifferentiation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ More generally take a change of the metric into account as
= Df(p)[X] = g_p(\operatorname{grad}f(p), X)
```

or in words: we have to change the Riesz representer of the (restricted/projected) differential of $f$ ($\tilde f$) to the one with respect to the Riemannian metric. This is done using ``[`change_representer`](@extref `ManifoldsBase.change_representer-Tuple{AbstractManifold, ManifoldsBase.AbstractMetric, Any, Any}`)``{=commonmark}.
or in words: we have to change the Riesz representer of the (restricted/projected) differential of $f$ ($\tilde f$) to the one with respect to the Riemannian metric. This is done using ``[`change_representer`](@extref `ManifoldsBase.change_representer-Tuple{AbstractManifold, AbstractMetric, Any, Any}`)``{=commonmark}.

### A continued example

Expand Down Expand Up @@ -187,7 +187,7 @@ This can be computed for symmetric positive definite matrices by summing the squ
G(q) = sum(log.(eigvals(Symmetric(q))) .^ 2) / 2
```

We can also interpret this as a function on the space of matrices and apply the Euclidean finite differences machinery; in this way we can easily derive the Euclidean gradient. But when computing the Riemannian gradient, we have to change the representer (see again ``[`change_representer`](@extref `ManifoldsBase.change_representer-Tuple{AbstractManifold, ManifoldsBase.AbstractMetric, Any, Any}`)``{=commonmark}) after projecting onto the tangent space $T_p\mathcal P(n)$ at $p$.
We can also interpret this as a function on the space of matrices and apply the Euclidean finite differences machinery; in this way we can easily derive the Euclidean gradient. But when computing the Riemannian gradient, we have to change the representer (see again ``[`change_representer`](@extref `ManifoldsBase.change_representer-Tuple{AbstractManifold, AbstractMetric, Any, Any}`)``{=commonmark}) after projecting onto the tangent space $T_p\mathcal P(n)$ at $p$.

Let's first define a point and the manifold $N=\mathcal P(3)$.

Expand Down
Loading