-
Notifications
You must be signed in to change notification settings - Fork 56
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
Integration into Optim #35
Comments
Thanks for asking! I think
I think issues 1-3 should be solved before |
I think it's fine to try it out in a system we know :) |
Not important if it's "our own" |
Thanks for this topic, I was not able to continue working the last month (sadly), I will continue to work on the SPDs hopefully next week – but I am on @mateuszbaran s side considering the basic API, but I would love to have at least a proper, complete documentation as well as maybe a few more manifolds before integrating somewhere. |
I've been reading the code in this package and thinking about using it in Optim going forwards. I'm super impressed, and the work seems super thorough. I still don't see an immediate need to split this package into separate packages; if you're opting in to one manifold, let's just provide all the batteries you could ever have thought of! But, and let me just undermine my own statement one sentence later, I think we may want to create just one additional package that is the "ManifoldsBase.jl". What is ManifoldsBase.jl? ManifoldsBase.jl has all the stubs, the generic interface, and so on. And quite importantly, it also has the |
Possibly another option would be to load ODE lazily if required? Also speaking of that, something that came up with @jagot is that he wanted to do a crazy manifold where he keeps some columns of a matrix orthogonal and some others normalized, the splitting being non-contiguous. What that illustrates is that it's important that users be able to define a manifold with just the two operations Optim needs, and not necessarily all the operations supported by this package. |
Thanks, we are trying to make this package as good as we can 🙂 . On my computer it takes 24 seconds to load Manifolds, that's way too much for a dependency.
This should take the loading time down to perhaps 3 seconds, maybe a bit less. That's about as much as
Yes, no one has to implement the full interface if they don't need it. Even many of our manifolds don't implement everything we have in our generic interface tests. Extending our functions would be totally fine IMHO. |
Why is Distributions needed? edit: let me clarify, I'm not in doubt about what it's used for, I'm just curious why it would be required in defining the stubs. |
We extend their |
Okay, so it is technically possible to just only support sampling if |
Right, that sounds reasonable. I'll add separating |
I also think
Unfortunately, I've not had the time to continue work on #25 and probably won't in the immediate future. Defining defaults for Lie groups is tricky.
This is probably wise even for |
I've looked at this again and essentially the last missing piece is gradient calculation. |
Optim uses manifolds as an opportunity feature - it takes a few lines of code to implement so why not. I think it's fine to keep Optim as a "poor man's manifold optimization" since the focus is on unconstrained optimization. Manopt.jl is there for more serious manifoldization. Unless there is a will to merge both packages? |
I think that's a good approach, since |
This has been inactive quite a while; on the other hand our API (ManifoldsBase.jl) is really stable by now – so besides the differences in the notion of a retraction, ManifoldsBase.jl could be used in Optim maybe (still staying on the opportunity/“poor mans variant” within Optim)? |
Yeah I think the status has been "oh yeah, somebody should really do it at some point" for a few years now :-) |
That is great to know – and don't worry, I know that status just too well. Then let's leave this issue open until this really actually happens – maybe I find the time as well, but I am not so experienced with the inner organisation of the Optim.jl code |
A small update: I've made a script that allows for using Manifolds.jl manifolds in current Optim.jl: https://gist.github.com/mateuszbaran/0354c0edfb9cdf25e084a2b915816a09 . Changing Optim.jl to using Manifolds.jl manifolds without a wrapper would be a breaking change with minimal benefits over using that wrapper. IMHO the best short and medium-term path forward is putting the glue code in some package (either Optim.jl or Manifolds.jl) as a package extension (a new Julia 1.9 feature). What do you think? |
Just a question for understanding – with this wrapper Optim would do “addition in the embedding and projection” in its solvers? I like the glue code idea especially since it is quite short. Maybe we can do an Issue in Optim to do the breaking change for the next larger update (that is when they have a breaking change anyways)? I would maybe put the glue stuff it into Optim, though I do not have a very good argumen, just a feeling – since the code extends the manifold-capabilities of Optim. |
Yes, that's what Optim.jl does. And also projecting tangent vectors.
Putting it in Optim.jl would make sense IMO but let's wait for an opinion of Optim maintainers. |
Does it maybe make sense to post this idea also at JuliaNLSolvers/Optim.jl#448 ? |
I think that topic is more about Optim.jl doing more than just |
ah, I see, right. |
I think it would make sense. I do not have too much bandwidth, but I'd love to help if I can. Optim.jl is fine for me. If we need to break, let's discuss. |
Hi,
I just checked back, it seems there has been lots of activity on this project, great! Is it ready for prime time? In particular, can we replace Optim's implementation of manifolds with this package? We can think about a deeper integration sometime in the future, but right now I think just supporting manifolds embedded in R^n using retraction and projection of a vector onto the tangent space for the Stiefel and sphere manifolds (the basic things implemented in https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/Manifolds.jl) with a stable-ish API will be enough.
@pkofod: or should we wait until the next-gen optim?
The text was updated successfully, but these errors were encountered: