|
|
|
|
|
by thomasahle
526 days ago
|
|
I've found that thinking of tensors in terms of graphs make Einsums much more natural. For example, a matrix product MN, `a b, b c -> a c` is just two nodes with two edges each: `-a- M -b- N -c-`. Their `b` edges are connected, so the resulting graph has only two "free" edges `a` and `c`. That's how we know the result is another matrix. Once you look at tensors this way, a number of things that are normally tricky with standard matrix notation become trivial. Such a higher order derivatives used in neural networks. I wrote https://tensorcookbook.com/ to give a simple reference for all of this. |
|