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

Introduce the manifold of symmetric positive definite matrices with two metrics #27

Merged
merged 50 commits into from
Nov 25, 2019

Conversation

kellertuer
Copy link
Member

This is the manifold of SPD matrices with

  • linear affine metric, which also provides a Lie group (soon to be merged/tested),
  • log-euclieadn metric (soon)

and I already have a question before I start documentation and testing, namely vector_transport: Is that meant to be parallel_transport or more general than that? If the second one is the case, then how do I specify a parallel transport?

Feel free to already revise existing code :)

@kellertuer
Copy link
Member Author

An and I already see, I'd also have to merge from #22 to get the CI running.

@dkarrasch
Copy link

And fix the file name ... 😄

@kellertuer
Copy link
Member Author

Yes, I was again too fast and fetched a cold two days ago -.-

@mateuszbaran
Copy link
Member

and I already have a question before I start documentation and testing, namely vector_transport: Is that meant to be parallel_transport or more general than that? If the second one is the case, then how do I specify a parallel transport?

I think we can do something similar to how different retraction methods are implemented: vector_transport accepts an argument that specifies what kind of vector transport is to be performed.

An and I already see, I'd also have to merge from #22 to get the CI running.

#22 changes a lot and I think it would be OK to just merge it soon. I would like to have this resolved though: #22 (comment) .

@kellertuer
Copy link
Member Author

That sounds good, to specify the type (and maybe default that to parallel transport).

The CI idea was mainly for me to keep track of :)

Copy link

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments. It seems generally favorable to use eigen instead of svd, since the Vt factor is never used anyway and is equal to transpose(U) by symmetry. Moreover, I'd suggest to use Symmetric whenever you know something is symmetric. That is a simple wrapper, which is fast to construct, in contrast to numerical symmetrization by n^2 additions à la T + transpose(T), whose symmetry would have to be obtained from yet another n*(n+1)/2 checks.

src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 6, 2019

Codecov Report

Merging #27 into master will decrease coverage by 13.27%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #27       +/-   ##
===========================================
- Coverage   72.95%   59.68%   -13.28%     
===========================================
  Files          10        9        -1     
  Lines         599      439      -160     
===========================================
- Hits          437      262      -175     
- Misses        162      177       +15
Impacted Files Coverage Δ
src/SymmetricPositiveDefinite.jl 0% <0%> (ø)
src/Metric.jl 86.51% <0%> (-0.99%) ⬇️
src/Manifolds.jl 58.66% <0%> (-7.59%) ⬇️
src/Euclidean.jl 0% <0%> (-61.54%) ⬇️
src/Rotations.jl 83.13% <0%> (-4.26%) ⬇️
src/Sphere.jl 89.18% <0%> (-2.92%) ⬇️
src/ProductManifold.jl
src/utils.jl
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1de7ef7...f999bc7. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 6, 2019

Codecov Report

Merging #27 into master will increase coverage by 1.17%.
The diff coverage is 81.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
+ Coverage   82.45%   83.62%   +1.17%     
==========================================
  Files          16       18       +2     
  Lines         986     1136     +150     
==========================================
+ Hits          813      950     +137     
- Misses        173      186      +13
Impacted Files Coverage Δ
src/ArrayManifold.jl 71.42% <ø> (ø) ⬆️
src/Rotations.jl 91.54% <ø> (ø) ⬆️
src/Sphere.jl 100% <ø> (+5.55%) ⬆️
src/Euclidean.jl 73.33% <100%> (+4.36%) ⬆️
src/utils.jl 75% <100%> (+0.8%) ⬆️
src/CholeskySpace.jl 100% <100%> (ø)
src/Manifolds.jl 67.27% <39.13%> (-4.73%) ⬇️
src/Metric.jl 76.38% <65%> (+4.96%) ⬆️
src/SymmetricPositiveDefinite.jl 87.71% <87.71%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d89736a...7af42cf. Read the comment docs.

@kellertuer
Copy link
Member Author

I just simplified most numerical eigens, but for one I had to symmetrisize (still), and at least the generalized eigen does not seem to work with forward diffs; since I got quite a lot of errors, but that may also be due to no aailabke retraction yet. For now its so many errors, that I can't even scroll back to the first one.

@kellertuer
Copy link
Member Author

And I noticed that retract has no fallback – we could just fallback that one to exp? Currently I have not yet thought about retractions on SPDs

@mateuszbaran
Copy link
Member

@mateuszbaran
Copy link
Member

OK, I'll look at it later and add these missing methods.

@kellertuer
Copy link
Member Author

This branch now works with the current version of MetricManifold and the documentation is done. So after a thorough review, I would propose to merge this.

@kellertuer kellertuer changed the title [WIP] Introduce the manifold of symmetric positive definite matrices with two metrics Introduce the manifold of symmetric positive definite matrices with two metrics Nov 24, 2019
Copy link

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on some performance aspects below. I wonder about a comparison to your Matlab code, at some point.

src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Outdated Show resolved Hide resolved
src/SymmetricPositiveDefinite.jl Show resolved Hide resolved
@kellertuer
Copy link
Member Author

I commented on some performance aspects below. I wonder about a comparison to your Matlab code, at some point.

Concerning the comparison to Matlab – without a thorough test, the Manopt.jl stuff is a little faster (without all these optimisations I am learning here) already. I have to check more thoroughly when I transferred Manopt.jl to be based on this package :)

@dkarrasch
Copy link

Sorry for my incomplete comments, and the additional work it triggers. I think it may be actually advantageous to have a test-passing version merged, and then come back and add some optimizations via PRs, with CI running and testing the proposed changes. I don't mean to hold this up by any means.

@kellertuer
Copy link
Member Author

kellertuer commented Nov 24, 2019

I am very thankful for all your comments and discussions. I think up to the Julia version check thing, I got most of it optimised (even the tv non projection thingy, though I have a copyto! left). So I favour all your comments, though it took some time now :) – so thanks for your time to look at this.

@kellertuer kellertuer merged commit 2660f7b into master Nov 25, 2019
@kellertuer kellertuer deleted the SymmetricPositiveDefinite branch February 9, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants