-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor ManifoldsBase to a two-level dispatch design #91
Conversation
Codecov Report
@@ Coverage Diff @@
## master #91 +/- ##
==========================================
+ Coverage 99.80% 99.84% +0.03%
==========================================
Files 15 17 +2
Lines 1556 1919 +363
==========================================
+ Hits 1553 1916 +363
Misses 3 3
Continue to review full report at Codecov.
|
...and just Maybe, when anyways writing a complete proper documentation, we can also use this to internally use traits for explicitly implemented features, that is
might become traits (on a middle layer kind of) in the following sense What I currently do not like is our Abstract/NonAbstract split in embeddedmanifolds for example. I would like to have this more like a trait, since the abstract (or maybe implicit) case can only be specified for one of these features. The idea would be that the non-implicit cases (for example metric and quotient combined) would provide default implementations that make things easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this! I've left a few comments for discussion.
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
Thanks for already checking grammar and such, this was a first sketch of ideas :) but sure it is good to have them also grammatically correct. |
Hm, why not just split the interface page instead of putting that content in the readme here?
No idea. I'm a bit biased here because I don't use zenodo citations myself 😉. But feel free to add it if you think it's a good idea.
I'm trying to figure out how a macro-based forwarding for decorators (in the style of #89 ) could look like and I'm not sure if it would be significantly more simple.
What lower layer fallbacks do you have in mind?
Cool, the two-level dispatch would definitely be a nice improvement.
Usage patterns of |
Sure, I mean to combine the new notes (and old stuff) from readme into the docs here (and see the Readme as short as the Maniolfds.jl one)
I am slo not yet 100% sure, since if one uses zenodo then probably the don from Manifolds.jl (and a fitting ManifoldsBase is implicit).
I am not 100% sure myself yet, but I have an idea, I just have to see where that leads me :)
really just the
Yes lets see. My current idea is mainly to use traits instead of the abstract cases and keep the concrete ones. |
OK, I just wouldn't really call it a fallback, it's the main implementation of that method. |
Ok, maybe fallback was not the best term to choose here. |
With the redesign we should even get rid of the Edit: Ah no, we don't ;) |
HM, I copied the docuemneter (nearly) from ManifoldDiffEx which also does not have its own documenter key, yet here it does not seem to use the org one - not yet sure why. |
I think removing would have to happen in a quite different way, and maybe let's not do too many things at the same time.
I'm not sure, maybe the newer Documenter will work? |
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
No and we do not get rid of it, since it would just introduce a lot of ambiguities again (trying to remove it). It should stay.
The problem seems to be the push at the end, not the rendering of the docs in general. |
Good, we're on the same page then :). |
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
…olds/ManifoldsBase.jl into kellertuer/two-level-refactor # Conflicts: # src/retractions.jl
* avoid manifold_function_error where possible (maybe remove completely with new deco) * reduce ambiguities
I've updated forwarding of some basis-related functions which fixes some issues with SPD manifold. Some inconsistency related to |
I'm not sure why we had |
We could also overload check size for this case – the default is just a lazy check with the matrix sizes (but I wrote new checks for FixedRank for example) |
Yes, that's a possibility if we actually need |
That is exactly why I currently implemented it (also for circle and positive numbers) to say: Ah - size is fine! when representation size is |
Can you maybe shortly explain why the fallbacks to the embedding where wrong code? I do not see that directly. |
For some functions they are fine, but specifically for |
Well I always thought of them as reasonable defaults, so then the one test case / manifold does not fit one can always implement the non-decorator case for this manifold specifically and keep them as general fallbacks? This way most manifolds would not need an implementation (for the embedded ones) since the cases you deleted act as their default implementation using the embedding. |
OK, this makes sense. I'll patch |
Great thanks. Maybe we should document this motivation / modelling more. |
Good idea, I'm sometimes not sure how things are supposed to work myself. |
Don'T worry me as well in some places, just here I put a lot of thought into these defaults myself, so I remember those and why I put them there (and what to do for the non default case). |
I've done the forwarding of |
BTW, I've updated a few manifolds in the Manifolds.jl branch. |
Yes that looks perfectly fine. I noticed that bot having the fallback for get_coordinates/get_vector night be ok, since not really many manifolds will have the same coordinates/vectors as their embeddings, so we can also keep the current state as is there. |
I started with hyperbolic and removed quite some forwards to So either the These seem to be the main remaiing errors with Hyperbolic. |
…d on the point representation.
I don't really understand it. A manifold is supposed to have a single embedding, and whatever representation of points is used, a point in the same embedding should be returned, right? And |
I would say that was a flaw in the old system, is mildly one in the system now as well. When using arrays or |
OK, making embedding dependent on the point is fine. |
We are slowly getting there. SkewHermitian has still a but but I fixed quite a few os the smaller manifolds (Spectrahedron etc) and Hyperbolic as well. |
Yes, Lie groups seem to be the only remaining big issue. |
Sorry for accidentally merging this. I think we need a new PR to continue 🙁 . |
Yes this was maybe a little early, though I think this might actually nearly be finished, so it might not be long anymore. |
I'm still unsure whether the trait system is going to be expressive enough for Lie groups but other than that it looks fine. |
This is a start to tackle #88.
I sketched the idea in the readme but there is a few points open to discuss
I think this might be my project for the last week of this year, if time permits. Let‘s also discuss a few details here, for sure.
What needs to be done
CaleyRetraction
or other vector tranportsEmbeddedRetraction
that performs a certain retraction in the embedding and projects the result (this generalises the projectionretration, which would be the same with exp).