euclidean gradient of simple function

35 views
Skip to first unread message

gpori...@gmail.com

unread,
Jun 23, 2016, 9:37:12 AM6/23/16
to Manopt
Hello everybody,

I am new to manopt and playing around a bit with it using the cost function

problem.cost = @(X) -trace(A*X);

with A symmetric on the spectrahedronfactory(n,r) manifold as an example. As euclidean gradient I would expect something like

problem.egrad = @(X) -A;.
However, this yields:

Error using trace
Matrix must be square.

Apparently, I am doing something wrong and I suppose there is an easy solution for this :)
I would appreciate any short help!

Cheers,
Gerard

Nicolas Boumal

unread,
Jun 23, 2016, 3:39:44 PM6/23/16
to Manopt
Hello Gérard,

In your cost function, X is an nxr matrix, so AX is not square and its trace is undefined. In the spectrahedron factory, what you get is actually Y (nxr) with the intent that Y*Y^T is nxn positive semidefinite. So your cost should be trace(Y^T A Y) (using that in a trace we can move things around).

Best,
Nicolas

gpori...@gmail.com

unread,
Jun 24, 2016, 8:24:52 AM6/24/16
to Manopt
Hi Nicolas, thank you very much!
Reply all
Reply to author
Forward
0 new messages