I'm deriving backpropagation step of training neural networks using vectorized equations. Following are two forward propagation equations between last hidden layer and output layer.
$$ Z^{[2]} = W^{[2]}A^{[1]} + b^{[2]} $$ $$ A^{[2]} = \hat{y} = g(Z^{[2]})$$
Where $g(z)$ is activation function.
Now in backpropagation, we calculate the change in cost function ($J$) w.r.t. all the parameters.
I've successfully calculated $\partial{J}/\partial{A^{[2]}}$ and $\partial{J}/\partial{Z^{[2]}}$ using chain rule. Now to calculate $\partial{J}/\partial{W^{[2]}}$, I've formed following chain
$$ \frac{\partial{J}}{\partial{W^{[2]}}} = \frac{\partial{J}}{\partial{A^{[2]}}} \frac{\partial{A^{[2]}}}{\partial{Z^{[2]}}} \frac{\partial{Z^{[2]}}}{\partial{W^{[2]}}}$$
Now to calculate $\frac{\partial{Z^{[2]}}}{\partial{W^{[2]}}}$, I used $ Z^{[2]} = W^{[2]}A^{[1]} + b^{[2]} $ equation which simply gives the derivation $ A^{[1]} $. But in literature, it's given as $ A^{[1]^{T}} $, which is transpose of my answer.
By checking dimensions of the answer, I could verify that the answer should be $ A^{[1]^{T}} $ instead if $ A^{[1]} $. But is there any general rule for such cases using which I could directly tell whether the derivative will be the transpose of a matrix or not without verifying dimensions?
I've also checked matrix cookbook but couldn't find any related thumb rules.