0 / 34
Lesson 20

Dot Product & Matmul

Dot product and matrix multiply:

np.dot(a, b)  # 1D dot
A @ B         # matrix multiply
Why this matters

Dot products and matrix multiply are the language of linear models: regression, projections, attention-style combinations of vectors, and layers in neural nets all reduce to these ops on arrays.

@ in Python reads like math and keeps code aligned with textbook notation.

ResourcesDocs, references & more โ€” opens in a new tab
๐ŸŽฏ Your Task

Dot of [2,3,4]ยท[5,6,7] โ†’ dot. [[1,2],[3,4]] @ [5,6] โ†’ mv.

np.dot(a,b), M @ v
exercise.py
โŒ˜โŽ run ยท โŒ˜โ† โ†’ nav
โ–ถ Output
Run your code to see output here.