I want expand an L2-norm with some matrix operation inside. Assume I have f(c) = $\sum_{i=0}^n ||x_i - c||_2^2 $
Should I do:
- $\sum_{i=0}^n [ ||x_i||_2^2 - ||c||_2^2 ] $
- $\sum_{i=0}^n [ ||x_i||_2^2 -2c^Tx_i + ||c||_2^2 ] $
where X = $[x_i,....,x_n] $
$x_n \in \mathbb R^d $ and X$ \in \mathbb R^{d*n} $
$$\|a-b\|^2 = \langle a-b, a-b \rangle= \|a\|^2-\langle a, b\rangle - \langle b,a\rangle +\|b\|^2$$
Hence the second one.
There is a term to describe the mistake of doing the first one, the freshman's dream.