Fig. 1: Matrix multiplication tensor and algorithms. | Nature

Fig. 1: Matrix multiplication tensor and algorithms.

From: Discovering faster matrix multiplication algorithms with reinforcement learning

Fig. 1

a, Tensor \({{\mathscr{T}}}_{2}\) representing the multiplication of two 2 × 2 matrices. Tensor entries equal to 1 are depicted in purple, and 0 entries are semi-transparent. The tensor specifies which entries from the input matrices to read, and where to write the result. For example, as c1 = a1b1 + a2b3, tensor entries located at (a1, b1, c1) and (a2, b3, c1) are set to 1. b, Strassen's algorithm2 for multiplying 2 × 2 matrices using 7 multiplications. c, Strassen's algorithm in tensor factor representation. The stacked factors U, V and W (green, purple and yellow, respectively) provide a rank-7 decomposition of \({{\mathscr{T}}}_{2}\) (equation (1)). The correspondence between arithmetic operations (b) and factors (c) is shown by using the aforementioned colours.

Back to article page