I have a loss function of the followoing form:
$L(\mathbf{a}) = \|\mathbf{b} - \mathbf{a}\|_2^2$
Where, $\mathbf{a}$ and $\mathbf{b}$ are vectors of dimension $d\times 1$. I need to calculate $\frac{\partial L}{\partial \mathbf{a}}$
If I am correct $\frac{\partial L}{\partial \mathbf{a}} = -2(\mathbf{b} - \mathbf{a})^T$ (I am not sure)
I have two questions:
- What is derivation of $\frac{\partial L}{\partial \mathbf{a}}$
- I know that $\frac{\partial L}{\partial \mathbf{a}}$ is a vector of dimension $1\times d$ instead of $d\times 1$ ($L$ is a scalar and $\mathbf{a}$ is a vector). In that case how can I update $\mathbf{a}$ based on gradient descent (because of different dimensionality)? The update rule is: $\mathbf{a} = \mathbf{a} - \beta \frac{\partial L}{\partial \mathbf{a}}$ ? ($\beta$ is the learning rate)