-
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
Introduce fallbacks for AbstractManifoldPoints and Vectors #89
Conversation
…es, especially broadcasting to be passed on to the .value field
I think I'd prefer a more granular approach with macros, like here for example: macro manifold_point_forwards(T::Symbol, field::Symbol)
return esc(quote
allocate(p::$T) = $T(allocate(p.$field))
allocate(p::$T, ::Type{P}) where {P} = $T(allocate(p.$field, P))
function allocate(p::$T, ::Type{P}, dims::Tuple) where {P}
return $T(allocate(p.$field, P, dims))
end
number_eltype(p::T) = typeof(one(eltype(p.$field)))
end)
end and so on for other methods. Advantages:
|
Sure, that also sounds good. Just that I do not feel experienced enough to program that and usually macros are also quite complex. Can you mean help? And should we do that here or first over at manifolds? |
Sure, I can write these macros. We can put some of them here, at least the part that would be useful to Validation manifold. |
Codecov Report
@@ Coverage Diff @@
## master #89 +/- ##
==========================================
- Coverage 99.85% 99.71% -0.14%
==========================================
Files 14 15 +1
Lines 1339 1414 +75
==========================================
+ Hits 1337 1410 +73
- Misses 2 4 +2
Continue to review full report at Codecov.
|
This should, more or less, work now. Macro |
Thanks for the fast help; I think the main question for the fallbacks macro is: Is it useful as a tool that should stay here? It is definite useful as a tool, so maybe it can stay here, since it would feel too heavy to load all of manifolds to just use it? |
OK, it can also stay here. Let me know it you need some more help with this PR. |
Great. I will check that the test coverage is given here while also using the macros already over at manifolds for the new type. Thanks for the help. |
…tion, introduce a 2-parameter variant.
This looks good so far and I am now trying to use it with Hyperbolic first and then for the actual idea on ProjectionPoints in Grassmann – we just also have to increase test coverage here on the newly introduced functions that are now automatically generated. |
…ixing ManifoldsBase.
I sketched the tests, but it seems the automatically introduced Edit: I first thought one just has to fix the allocation type, but somehow adding that to the macro did not help, when calling it it does not return the new tangent vector type, which I hoped I had done, so I do currently not understand why the allocation fails (and hence the log does as well) |
I'm just looking at it and it doesn't even reach |
In my error it looks like It reaches
|
As mentioned above we could also add retractions and inverse retractions and the vector transport to that macro, if that does not destroy the rest of the world (maybe it does ;) ). |
Let's fix the current code first... I've just noticed that I have forgotten to pull new changes which caused the problem of not reaching |
I've fixed a bunch of cases. Currently the one that fails is |
I would say similar to the |
Maybe it would make more sense to unwrap, call |
Oh, that sounds really reasonable as well! |
I've fixed that vector problem and some more. Now the problem is with |
The MatrixVectorTransport just models a curve – creating it correctly for the DefaultPoint solved that point. |
Maybe we can resolve the vector transport ambiguities similar to how you resolved the vector/coordinate functions? |
I think so, I'll try doing that today. |
…verse_retract and the vector_transports.
I had a moment and extended test coverage a little bit, but
are not covered yet. For the first 4 I ran into Ambiguities again, I left the two for retract and inverse retract in (as broken tests) but I have no good idea yet how to resolve them. |
|
I see, maybe than it is not worth having these in the macro? edit: to be precise neither retract! nor inverse_retract! nor the vector_transort_X!, since they all require a manual resolving anyways. |
Yes, I've removed them. |
Oh noes we increased the not-covered lines by 50% (2-3) – we could check for those maybe, but in general I think this PR should work for now :) Or the analysis was not yet finished, since in the web interface of codecov it still reports 2 lines (and no missing line for the PowerManifold). |
The new non-covered line is, I think, a false positive, there is nothing we can do about it. |
I'll review it once again sometime soon but this indeed seems to be complete. |
When I find time (during exam/corrections time and preparing for the new semester starting January 10) I will apply these to the Projector-Grassmann-branch I started with before this detour ;) |
While working on a second type for the Grassmann manifold, I endet up noticing that I would reimplement quite some stuff we did for Hyperbolic already, especially including the broadcast.
Also for a default type (for the Stiefel representation) on would reimplement all exp/log/...
so I thought one could also do this pass-through to the -value field by default such that a new point/tangent type has only to reimplement the stuff that is new/different.
This is currently done after all other stuff (bases / defaults) is done, i.e. on the lowest levels
I have not yet finished
but this would reduce quite some code in manifolds and omit quite some code I saw I would have to write next in Grassmann. What do you think?