Hello Allan,
In this case, it is possible to optimize for P with Manopt to a critical point of the red part. Below is the sample code. We assume that you have already defined L, X, Z, E, Y, alpha, and mu. Assume also that P is of size n-by-r.
problem.M = stiefelfactory(n, r);
problem.cost = @cost; % Cost function handle.
function f = cost(P)
Errormat = P'*X - P'*(X*Z) - E;
f = alpha*trace(P'*(L*P)) + trace(Y'*Errormat) + 0.5*mu*norm(Errormat, 'fro')^2;
end
problem.egrad = @egrad; % Gradient function handle of the objective function.
function grad = egrad(P)
Errormat = P'*X - P'*(X*Z) - E;
L = 0.5*(L + L'); % The gradient depends only on the symmetric part of L.
grad = 2*alpha*(L*P) + X*Y' - (X*Z)*Y' + mu*((X - X*Z)*Errormat');
end
checkgradient(problem); % Check whether the gradient computation is correct.
Popt = trustregions(problem); % Call the trust-regions solver. other choices include steepestdescent and conjugategradient.
Let us know if you require further inputs. I hope, I did not make a mistake in the gradient computation, but do verify it.
Regards,
Bamdev
On Sat, Jul 2, 2016 at 1:35 AM, Allan Ding wrote:Hi Bamdev,
Thanks for your kind reply.
Actually, I want to solve this problem
where X is the data matrix, L is a known matrix and I is the identity matrix. Since it its hard to jointly optimize P, Z, E, so I optimize one by one. When Z, E are fixed, I aim to update the following Lagrange function:
where Y and \mu are parameters. For this case, can I first calculate the gradient of red box part w.r.t P, then apply Manopt to optimize P with the orthogonal constraint? Thanks
Best,
Allan