I'm currently analyzing the expressions for backpropagation in machine learning and it takes me a lot of time to convert my derived formulas into matrices. I can't find anything helpful on google, though I may not know the keywords I need. But I think it's generally called vectorization.
For example when multiplying two matrices A and B I noticed that sums go horizontal in the left matrix A and vertical in the right matrix B (that's just how matrix multipliation works). But it's still not intuitive enough for me to see how the indices run and I have to constantly check how to arrange variables such that the right variables get multiplied by each other and resulting numbers end up at the right place in a matrix which also needs to be the right size (and sometimes I also need to transpose it).
Is there an intuitive way to quickly visualize in my mind how an arbitrary expression would look like in a matrix form? Maybe also some algorithm that is simple to understand and execute on paper? After all Matlab has a vectorize function which by my understanding does just that.
Vectorizing is done everywhere nowadays so I'm very surprised I can't find any good sources to teach me how to vectorize expressions. Or maybe I'm just searching wrong.
Here is an example of things I vectorize:
