Computing the gradient of a function of a matrix

693 views
Skip to first unread message

Nicolas Boumal

unread,
Sep 23, 2014, 8:14:11 AM9/23/14
to manopt...@googlegroups.com
Hello,

Computing the gradient of a function whose arguments are matrices is a recurring question regarding the usage of Manopt.

This nice blog post should be useful to learn the basic trick:


In a nutshell: the idea is to first compute the Fréchet derivative (or directional derivative) of the function; then to manipulate that expression in order to read off the gradient from it. This will give you the Euclidean gradient of your function, which you can input in Manopt as problem.egrad (notice the "e" in front of egrad, for Euclidean). Manopt will convert that to the Riemannian gradient automatically (for most geometries available; contact us if it's missing in a geometry you are using).

This is also discussed at length in my book, announced here:


Cheers,
Nicolas
Message has been deleted

Nicolas Boumal

unread,
Jan 18, 2018, 10:41:25 AM1/18/18
to Manopt
This online tool can also be useful in automatically computing expressions for gradients of matrix functions:


Thanks to Justin Solomon for pointing this out!

Nicolas


On Tuesday, September 23, 2014 at 8:14:11 AM UTC-4, Nicolas Boumal wrote:
Hello,

Computing the gradient of a function whose arguments are matrices is a recurring question regarding the usage of Manopt.

This nice blog post should be useful to learn the basic trick:


In a nutshell: the idea is to first compute the Fréchet derivative (or directional derivative) of the function; then to manipulate that expression in order to read off the gradient from it. This will give you the Euclidean gradient of your function, which you can input in Manopt as problem.egrad (notice the "e" in front of egrad, for Euclidean). Manopt will convert that to the Riemannian gradient automatically (for most geometries available; contact us if it's missing in a geometry you are using).

Cheers,
Nicolas
Reply all
Reply to author
Forward
Message has been deleted
0 new messages