Skip to content

Commit

Permalink
Convert SPDs!
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Aug 19, 2023
1 parent e35fcfc commit e770b0c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ @incollection{AbsilMahonyTrumpf:2013
PAGES = {361--368},
TITLE = {An Extrinsic Look at the Riemannian Hessian},
BOOKTITLE = {Geometric Science of Information},
}
@article{Nguyen:2023,
DOI = {10.1007/s10957-023-02242-z},
EPRINT = {2009.10159},
EPRINTTYPE = {arXiv},
YEAR = {2023},
MONTH = jun,
PUBLISHER = {Springer Science and Business Media {LLC}},
VOLUME = {198},
NUMBER = {1},
PAGES = {135--164},
AUTHOR = {Du Nguyen},
TITLE = {Operator-Valued Formulas for Riemannian Gradient and Hessian and Families of Tractable Metrics in Riemannian Optimization},
JOURNAL = {Journal of Optimization Theory and Applications}
}
25 changes: 25 additions & 0 deletions src/manifolds/SymmetricPositiveDefiniteAffineInvariant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,31 @@ function parallel_transport_to!(M::SymmetricPositiveDefinite{N}, Y, p, X, q) whe
return copyto!(Y, vtp)
end

@doc raw"""
riemannian_Hessian(M::SymmetricPositiveDefinite, p, eG, eH, X)
The Riemannian Hessian can be computed as stated in Eq. (7.3) [Nguyen:2023](@cite).
Let ``\nabla f(p)`` denote the Euclidean gradient `eG`,
``\nabla^2 f(p)[X]`` the Euclidean Hessian `eH`, and
``\operatorname{sym}(X) = \frac{1}{2}\bigl(X^{\mathrm{T}+X\bigr)```
the symmetrization operator. Then the formula reads
```math
\operatorname{Hess}f(p)[X]
=
p\operatorname{sym}(\nabla^2 f(p)[X])p
+ \operatorname{sym}\Bigl( X\operatorname{sym}\bigl(\nabla f(p)\bigr)p)
```
"""
riemannian_Hessian(M::SymmetricPositiveDefinite, p, eG, eH, X)
function riemannian_Hessian(::SymmetricPositiveDefinite, Y, p, eG, eH, X)

Check warning on line 432 in src/manifolds/SymmetricPositiveDefiniteAffineInvariant.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/SymmetricPositiveDefiniteAffineInvariant.jl#L432

Added line #L432 was not covered by tests
# The following formulae even work for complex, H-symmetric positive definite matrices.
# the term within the seconds summands outer \sym:
Y .= X * 0.5 * (eG' + eG) * p
Y .= p * 1 / 2 * (eH' + eH) * p + 1 / 2 * (Y' + Y)
return Y

Check warning on line 437 in src/manifolds/SymmetricPositiveDefiniteAffineInvariant.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/SymmetricPositiveDefiniteAffineInvariant.jl#L435-L437

Added lines #L435 - L437 were not covered by tests
end

@doc raw"""
riemann_tensor(::SymmetricPositiveDefinite, p, X, Y, Z)
Expand Down

0 comments on commit e770b0c

Please sign in to comment.