I am trying to solve a problem on Stiefel manifold using MANOPT but facing some errors. I could not figure out how solve the problems.
Any generous help or suggestion is highly appreciated. The problem that I want to implement, is as follows-
\begin{equation*}
\min_{O_1, \ ...\ , \ O_M \in \mathbb{O}(d)} \Tr (C O^T O)
\end{equation*}
\begin{equation*}
\text{where, } O=[O_1, \ ...\ , \ O_M ], \ C \in \mathbb{S}^n_+.
\end{equation*}
A part of my program-
%% Manopt Code ---->
% Create the problem structure.
manifold = stiefelfactory(d,d,M);
problem.M = manifold;
% Define the problem cost function and its Riemannian gradient.
problem.cost = @(O) cost(O);
function f = cost(O)
f = 0;
for i = 1:M
for j = 1:M
f = f+trace(O(:,:,i)*C((i-1)*d+(1:d),(j-1)*d+(1:d))*...
O(:,:,j)');
end
end
end
problem.grad = @(O) manifold.egrad2rgrad(O,egrad(O));
function g = egrad(O)
g = zeros(d,M*d);
for i = 1:M
h = zeros(d,d);
for j = 1:M
h = h+2*O(:,:,j)*C((j-1)*d+(1:d),(i-1)*d+(1:d));
end
g(:,(i-1)*d+(1:d)) = h;
end
end
% Solve.
[O_s,f_cost,info,options] = trustregions(problem);
manifold = stiefelfactory(d,d,M),
but in the documentation I noticed that-
% Points are represented as matrices X of size n x p x k (or n x p if k=1,
% which is the default) such that each n x p matrix is orthonormal,
% i.e., X'*X = eye(p) if k = 1, or X(:, :, i)' * X(:, :, i) = eye(p) for
% i = 1 : k if k > 1. Tangent vectors are represented as matrices the same
% size as points.
So, I thought that O_i could be presented as O(:,:,i). Please correct me if I was wrong. Could you please give me some suggestions about how to write the desired cost function that? I think that I might do the same mistake while computing the gradient.
Thank you sir for your insight. I got the point. I will definitely go through the material that you have referred.
Thank you again for your generous help.
Sincerely,
Rajat.