-
Notifications
You must be signed in to change notification settings - Fork 1
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
Machine Learning Support #7
Comments
Thanks for you idea! I would like to shortly comment
The first two should already be widely available – but an implementation would anyways just use the interfaces from ManifoldsBase. And a manifold that wants to use the ML methods should implement the necessary. Finally I would like to discuss whether this is in scope of the package. I don't want to say, that it's not nice stuff, just that |
Hi,
Important, we do not project on the tangent space directly at this point, rather, we first parallel transport all points to the center of the manifold (identity). In the pos def manifold this can be done directly on the manifold (see here and reference therein). This step is crucial to achieve good machine learning performance and also instrumental to operate transfer learning. For a general manifold, what we need is to
In summary, what is needed is
Are all ingredients (besides the last one) available for all manifolds in Manifold.jl? As per the scope, i would keep it in a separate package, something like PosDefManifoldML.jl also implements machine learning models acting directly on the manifold. For those, all is needed is a function for computing the mean of several points and a distance function.
|
Thanks for the clarifications. I still don't follow the “center”, if its not the mean. So your “center” is always the identity? As the neutral element of the Lie group it has nice properties for SPDs, however, it is in general not available. I am a little stuck on your terms – you can only parallel transport tangent vectors not points. So to clarify: With Concerning the functions (distance, mean, log, parallel transport), they are all available for nearly all manifolds that we have currently implemented (where I would still suggest to to Concerning the scope: I think it's a great idea to start a package like |
Thats great Ronny,
I will definitely need your input! To clarify, yes, of course i am talking about transporting tangent vectors in the expected way as you describe, however one nice property of the pos def manifold is that the same transformation applies to points on the manifold, as explained here and proved in the reference therein. This is just a tachnical point, forget about it. It is good enough to have a preferred point for parallel transporting the tangent vectors, which would be the identity for the pos def manifold and something else for the others. By the way, the reason why this works well is that when you have another set of points, independent from the first, hence with a different mean, by parallel transporting it to the identity as well makes the model you already computed a workable model. There are several works showing this and i can point to them if someone is interested. All the best |
Ah, I missed that detail. Thanks for clarification. If you start working, just give me a note and I'll hapily help. Concerning the working best – I trust you, but it would also be fine to “parallel transport the model” from one tangent space to another in order to be able to compare. We should collect such literature in the documentation, too. |
Great, I'd definitely like to see support for ML on manifold-valued data 👍 . I can help with this as well 🙂 . Regarding that vectorization, there are a few different ways this can be done. We have the |
Great Mateusz, i will let you know in this thread when i find some time for this. Looking forward to hearing your and Ronny's ideas on the vectorization when the time comes. And, by the way, thanks for the CovarianceEstimation.jl package. It's very handy! |
Nice to hear that you like With JuliaManifolds/Manifolds.jl#86 merged, we have vectorization, so |
Hi @Marco-Congedo, We have for a while a I haven't had the time to look closely at |
Hello Ronny, |
Hallo Marco, But yes, for the pure linear part, coupling it to the best ML package is an approach I would've taken, too. Currently, I am a little busy (and not too familiar with MLJ neither). |
Hello, i am not familiar with MLJ.jl either. PosDefManifoldML.jl handles directly positive definite matrices, with (so far) a classifier in the PD manifold and two classifiers in the tangent space (handling the tangent space and vectorization step automatically). However, this only works for the PD manifold. |
Then it would also be interesting, whether the classifier on the PD manifold can begeneralized to other manifolds – does it mainly use geodesics? “Just” the Euclidean case is – I think – not a package, since it would just require the steps above, logs/transports/coordinates, and MJL. The three steps before are all just one line each. |
The classifier acting on the manifold that i implemented is the minimum distance to mean (MDM), which only needs the concept of distance along the geodesic and the concept of barycenter. This is a special case of kNN, which only needs the concept of distance. The geodesics should be unique, not sure it would make sense on all manifolds you support. Despite its simplicity, the MDM has proven a good classifier in the brain-computer interface field, however passing in the tangent space and adopting more complex classifiers (in particular, support vector machines and LASSO logistic regression) ususally gives better performances, sometimes much better. Another popular way to treat manifold data is to obtain features by Laplacian (Diffusion) Eigenmaps, based on the inter-distance matrix. This only requires the concept of distance (by the way, i implemented a couple of these methods in PosDefManifold.jl) Just to make it clear, PosDefManifoldML.jl does the following: it takes PD matrices as input and allows to fit a model/make prediction with it and to test models using cross-validation.
Indeed, i guess making a more general package along the lines of PosDefManifoldML.jl could allow the support for several manifolds. |
Thanks for all the details. With the uniqueness of geodesics, this can of course be (locally) done on any manifold, also barycentre or means are available on all our manifolds. So if I find time (most probably only after the semester in Germany so basically after JuliaCon) I'll take a look. I already know about SVM and Lasso. |
OK, let me know when you are in. I will have a new student in October who may join. As per the Laplacians, i have already code available in PosDefManifold.jl. As per PosDefManifoldML.jl, actually it should suffice to add a manifold as argument in the ML model constructors (now there is an argument 'metric', to apply any of the 10 metrics implemented in PosDefManifold.jl) and to call the appropriate functions depending on the manifold. Cheers. |
I started a package at ManifoldML.jl, so let's discuss further details there? It might be worth
|
Great, thanks for staring this!
Moving |
I think ManifoldStatistics (or ManifoldStats) would be reasonable as a kind of interface (specific more efficient means should stil be here). But for me that also depends on starting more with distributions, otherwise I feel it might be “too small”? For now the ML can also just work with Manifolds as a dependence, its only in development for quite some time, I think, anyways. |
Sure, there is no rush to make ManifoldsML.jl independent from Manifolds.jl. |
Hello,
following this discussion, the steps followed by PosDefManifold.jl for doing classification in the tangent space are:
parallel transport of all points to the center of the manifold (identity for the positive definite matrices manifold). This involves the computation of a center of mass of the points in the manifold and a function for parallel transport.
Exponential map (projection on the tangent space)
vectorization (a special one, for example, for the pos def manifold a weight √2 is given to the off-diagonal elements)
I am not familiar with other manifolds. Are all these operations possible with all currently implemented manifolds?
The text was updated successfully, but these errors were encountered: