I want to compute the hessian of following function $$f(x) = (a^T x)^2$$
where $a,x \in \mathbb{R^n}$
Therefore H is given by: $$H = \nabla_a \nabla_a^T f = \nabla_a \nabla_a^T (a^T x)^T (a^T x ) $$.
How do I apply $\nabla_a^T$. Is this to be understood element wise, so I should end up with a row vector, in this case the jacobian and in the second step then with a column vector: $\nabla_a (2a^Txx^T) = 2xx^T $
So my heurstic way is to apply $\nabla^T$ on the column vector $a$ and in the second step apply $\nabla$ on the row vector $a^T$ ?