TITLE: Derivative of spectral norm of symmetric matrix
QUESTION [10 upvotes]: I want to calculate the derivative of the spectral norm of a symmetric square matrix $W$:
$$
\frac{\partial}{\partial w_{ij}} \|W\|_2 
$$
How should I go about this?

REPLY [10 votes]: Let $W \in \mathbb{R}^{m\text{x}n}$. $f(W)=||W||_2 = \sigma_1(W)$, where $\sigma_1(W)$ stands for the larger singular value of (W). 
The SVD decomposition of $W$ is $W=U\Sigma V^{T}$. So $||W||_2=e_1^{T}U^{T}(U\Sigma V^{T})V e_1$. Hence, $f(W)=u_1^{T}Wv_1$, where $u_1$ and $v_1$ are the first column vectors of $U$ and $V$, respectively.
Hence, the derivative can be computed as:
$Df(W)(H)= u_1^{T}Hv_1 = trace(u_1^{T}Hv_1) = trace(v_1u_1^{T}H)$.
Thus, the gradient is $\nabla f(W) = v_1u_1^{T}$.
Ps.: Notice that a sufficient condition for the existence of the derivative is that $\sigma_1 \neq \sigma_2$, otherwise the maximization problem in the induced 2-norm has more than one argmax.