-
Notifications
You must be signed in to change notification settings - Fork 40
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 an EmbeddedObjective #286
Conversation
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
========================================
Coverage 99.73% 99.74%
========================================
Files 76 77 +1
Lines 6892 7017 +125
========================================
+ Hits 6874 6999 +125
Misses 18 18
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
I think the general idea looks good, I think just a few minor comments.
This PR resolves #217 by proposing an EmbeddedObjective– maybe one could also better all it EmbeddedManifoldObjective?
I think EmbeddedManifoldObjective
would be more consistent with the other names?
which functions can we extend this to? Hessian for sure, maybe also proximal maps.
Is there actually a generic way to convert a Euclidean proximal map to a Riemannian one?
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
That's what I thought as well when already writing this PR ;)
You might be right, that that is not the case – but the constraints and their gradients, the differentials, they should be possible as well. |
…lds/Manopt.jl into kellertuer/EmbeddedObjective
I think I now also sketched the hessian, before doing that for the constraints – since that is quite some work (though more in writing cases than in much thinking) I would like to discuss/check whether
edit: also this one for now has to wait for JuliaManifolds/ManifoldDiff.jl#30 |
In order to have a nice tutorial, this probably also should wait for JuliaManifolds/Manifolds.jl#644 |
# Conflicts: # Project.toml # docs/make.jl # src/plans/plan.jl
This is just missing a bit of testing, but the tutorial is at least basically finished – it needs JuliaManifolds/Manifolds.jl#644, and I have to check while for now the Hessian conversion on Grassmann is not (yet) correct. |
Sorry for the tag a bit too early, I missed the “automatic conversion to embedded objectives” for sub solvers (and was wondering why embedded worked so poorly with ARC). |
One thing I am a bit confused about it, that on https://manoptjl.org/previews/PR286/tutorials/EmbeddingObjectives/ the second run (with the euclidean ones converted) sometimes does work (yesterday evening) sometimes not (today) – on my machine that consistently needs 7 iterations and not 40 (which is the ARC default max iter). Not sure what the CI is doing there. |
Ah, the main point is that I am stupid. Quarto renders on the last registered version. So sure that is the old one and hence fails. I will trick that a bit for this tutorial now. |
This PR resolves #217 by proposing an
EmbeddedManifoldObjective
.Idea
embed(M,p)
get_gradient
– but then also callsriemannian_gradient
on the gradient the original objective returnsInterface
since we have the
decorate_objective!
chain already available, just introducing theobjective_type=:Euclidean
keyword there makes it possible for any objective to be wrapped. Currently also:Embedded
is equivalent, since it actually works more general then just Euclidean – but:Euclidean
is easier to understand for most users.Internals
The
EmbeddedManifoldObjective
has two (optionally used) fieldsp
andX
for a point and tangent vector in the embedding. That way one can useembed!
orget_gradient!
in the embedding. This should reduce allocations tremendously.ToDo
get_cost
get_gradient
/get_gradient!
get_hessian
/get_hessian!
get_grad_equality_constraint
/get_grad_equality_constraint!
(the the plural)get_grad_inequality_constraint
/get_grad_inequality_constraint!
(and the plural)