Neuron 101

Math foundations / Matrix multiplication

Türkçe

Plate4

Unit 1 · Topic 4 of 11

Matrix multiplication

Medium, 7 min, 7 steps

2−13402A2 × 312013−2B3 × 2C2 × 2×=
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 7 Matrices

Two matrices

A has 2 rows and 3 columns, B has 3 rows and 2 columns. We will find their product C.

Open in Colab
  1. A = [[2.0, -1.0, 3.0],
  2. [4.0, 0.0, 2.0]]
  3. B = [[1.0, 2.0],
  4. [0.0, 1.0],
  5. [3.0, -2.0]]
  6. C = [[sum(A[i][k] * B[k][j]
  7. for k in range(3))
  8. for j in range(2)]
  9. for i in range(2)]
  10. print(C)
i
1
j
1
sonuc
11