Hi all,
I am new to manifold optimization and manopt. I was trying to play around with manopt introduction script to learn.
I am facing problem with convergence of manopt with complexcircle manifold and complex inputs.
Basically I checking the slope of the gradient with checkgradient(problem);
It works fine with real inputs.
It also works fine with sphere manifold (for both real and complex inputs).
Initially I thought problem could be with gradient. However, same expression works with spehre manifold and complex input.
Here is the code I used for testing. Please point out the mistake.
%matlab code
close all
% Generate random problem data.
n = 10;
% Create the problem structure.
%manifold = spherefactory(n);
manifold = complexcirclefactory(n)
problem.M = manifold;
% A = randn(n);
A = 2*eye(n)
A = .5*(A+A.');
b = 2*ones(n,1);
problem.cost = @(x) (norm(A*x -b))^2;
problem.egrad = @(x) 2 * A' *A*x - A' * b - A * conj(b) ; % notice the 'e' in 'egrad' for Euclidean
% Numerically check gradient consistency (optional).
checkgradient(problem);
% Solve.
[x, xcost, info, options] = trustregions(problem);
x
norm(x)
% Display some statistics.
figure;
semilogy([info.iter], [info.gradnorm], '.-');
xlabel('Iteration number');
ylabel('Norm of the gradient of f');
%complex input
A = 2*eye(n) + 4i * eye(n);
A = .5*(A+A.');
% b = 2*ones(n,1) + 1i * 2*ones(n,1);
b = [1:10]' + [1:10]' *1i;
problem.cost = @(x) (norm(A*x -b))^2;
problem.egrad = @(x) 2 * A' *A*x - A' * b - A * conj(b); % notice the 'e' in 'egrad' for Euclidean
% Numerically check gradient consistency (optional).
figure
checkgradient(problem);
% Solve.
[x, xcost, info, options] = trustregions(problem);
x
norm(x)
% Display some statistics.
figure;
semilogy([info.iter], [info.gradnorm], '.-');
xlabel('Iteration number');
ylabel('Norm of the gradient of f');