Using Product Manifolds

105 views
Skip to first unread message

Ken Rayner

unread,
Jan 27, 2024, 9:00:22 PMJan 27
to Manopt
Would I be able to get some advice on how to write cost functions using multiple matrices from the same selected manifold (namely the spherical manifold)?

Does manoptAD work for cost functions containing multiple matrices?

My hope is that in future I will be able to use a product manifold but let the number of products vary.

That is, I want to be able to set a parameter n of how many matrices I need with unit frobenius norm.

Is this possible?

Thanks in advance :)

Nicolas Boumal

unread,
Feb 3, 2024, 9:45:10 AMFeb 3
to Manopt
Hello,

> Does manoptAD work for cost functions containing multiple matrices?

Yes, manoptAD works for manifolds created by productmanifold.

If what you want is to optimize over K matrices of size NxM, each of which has unit Frobenius norm, you could also do this (I expect it would lead to faster code, if that's relevant for your use case):

problem.M = obliquefactory(N*M, K);  %  this is the manifold of matrices of size (N*M) x K whose columns each have unit norm

Then, whenever you get a point X on the manifold, you can form the matrices with XX = reshape(X, [N, M, K]);  Now XX(:, :, 1) is the first matrix, X(:, :, 2) is the second one, etc.

To transform an array of matrices G into a matrix again (e.g., for the gradient), you call reshape(G, [N*M, K]);

I hope this helps,
Nicolas

Nicolas Boumal

unread,
Feb 3, 2024, 9:45:38 AMFeb 3
to Manopt
By the way, powermanifold is perhaps more relevant that productmanifold here.

Ken Rayner

unread,
Feb 3, 2024, 8:29:05 PMFeb 3
to Manopt
Thanks Nicolas!

Are there any examples online of how to use powermanifold?

Nicolas Boumal

unread,
Feb 4, 2024, 3:04:46 AMFeb 4
to Manopt
Your question makes me realize we do not have an example.


That is test code for automatic differentiation. It shows you how to create a powermanifold and how to write a cost function with it. It does not show how to compute the gradient (because it does it automatically... :)), but it's fairly straightforward: point and tangent vectors are represented as cells (a Matlab data structure), so you create the gradient as a cell also.

Ken Rayner

unread,
Feb 8, 2024, 10:17:58 PMFeb 8
to Manopt
Thanks so much Nicolas!
Reply all
Reply to author
Forward
0 new messages