I was trying to derive a general formula for backward automatic differentiation of a matrix-vector product.
The task is basically the following:
$$A\cdot x= b$$
We assume that $\dfrac{dE}{db}$ is given (E is any value which is not in the scope of this question), I want to calculate $\dfrac{dE}{dA}$ and $\dfrac{dx}{dA}$.
I am stuck at writing a general form for $\dfrac{dE}{dA}$.
This is what I did:
$$\dfrac{dE}{dA} = \dfrac{dE}{db} \cdot \dfrac{db}{dA}$$
Writing this down in tensor notation:
$$\dfrac{dE}{db_i}(e_i) \cdot \dfrac{db_j}{dA_{mn}}(e_j \otimes e_m \otimes e_n)$$
But I did not manage to simplify this. Obviously a tensor of rank 2 should be the result.
I guessed the following result:
$$\color{red}{\dfrac{dE}{db_i} \dfrac{db_j}{dA_{mn}} (e_i) \cdot (e_j \otimes e_m \otimes e_n)}$$ $$\color{red}{= \dfrac{dE}{db_i} \dfrac{db_j}{dA_{mn}} \delta_{in} (e_j \otimes e_m)}$$ $$\color{red}{= \dfrac{dE}{db_i} \dfrac{db_j}{dA_{mi}} (e_j \otimes e_m)}$$
I looked through my books to find a suitable solution but only found tensor product where the first tensor has a higher rank than the second one. The problem with my solution is especially that $b$ can be a different size than the second size dimension of $A$.
I am very happy if someone could help me here!
Greetings, Finn
Thanks to @user619894 who suggested to use $i=j$, I got to the following:
$$\dfrac{dE}{dA_{mn}} = \sum_i {\dfrac{dE}{db_i} \cdot \dfrac{db_i}{dA_{mn}}}$$
It's important to see that $\dfrac{db_i}{dA_{mn}}$ is only different from $0$ if $m=i$.
Therefor the sum reduces to:
$$\dfrac{dE}{dA_{mn}} = \dfrac{dE}{db_m}\cdot x_n$$