Matrix multiplication

Also: matrix product, matmul

Entry (i, j) of AB is the dot product of row i of A with column j of B, so the inner dimensions must match. It composes linear maps and is the operation that dominates neural-network compute.

(AB)ᵢⱼ = Σₖ Aᵢₖ Bₖⱼ

Example

[[1, 2], [3, 4]] × [[5], [6]] = [[1·5 + 2·6], [3·5 + 4·6]] = [[17], [39]]: a 2×2 times a 2×1 gives a 2×1.

See it in the lesson: Linear Algebra & Calculus Refresher →

Related terms

More in Linear Algebra & Calculus