3 ms·
For all of the listed applications there is a cleaner function in numpy (and tensorflow, right?) Vector inner product: "a,a->" (Assumes two vectors of same
by singularity2001 8y ago
For all of the listed applications there is a cleaner function in numpy (and tensorflow, right?)
Vector inner product: "a,a->" (Assumes two vectors of same length)
Vector element-wise product: "a,a->a" (Assumes two vectors of same length)
Vector outer product: "a,b->ab" (Vectors not necessarily same length.)
Matrix transposition: "ab->ba"
Matrix diagonal: "ii->i"
Matrix trace: "ii->"
1-D Sum: "a->"
2-D Sum: "ab->"
3-D Sum: "abc->"
Matrix inner product "ab,ab->" (If you pass twice the same argument, it becomes a matrix L2 norm)
Left-multiplication Matrix-Vector: "ab,b->a"
Right-multiplication Vector-Matrix: "a,ab->b"
Matrix Multiply: "ab,bc->ac"
Batch Matrix Multiply: "Yab,Ybc->Yac"
Quadratic form / Mahalanobis Distance: "a,ab,b->"
- blt 8y agoSure. The point of those examples is to use familiar operations to help the reader understand how the notation works, and show the generality.