The categorical cross entropy loss is expressed as:
$$L(y,t) = -\sum_{k=1}^{K}t_k\ln{y_k}$$
where $t$ is a one-hot encoded vector. $y_k$ is the softmax function defined as:
$$y_k = \frac{e^{z_k}}{\sum_{j=1}^{K}e^{z_j}}$$
I want to compute the gradient, $\nabla_z$, of the loss function with respect to the input of the output node. What I know: I understand how to compute the partial derivative of L with respect to a selected node (say, $z_k$). This yields the following expression:
$$\frac{\partial L}{\partial z_k} = y_k - t_k$$
But I am not sure how to generalize this to the entire vector, $z$. In essence, I know how to compute $\frac{\partial L}{\partial z_k}$ when $k = j$ and $k \neq j$, but I don't know how to calculate the gradient, $\nabla_z$.