dot product
Say it “a dot b”
Multiply matching entries and add them up. Gives one number that's large when the vectors point the same way.
Example
In code
a @ b # or np.dot(a, b)a @ bWhere you’ll see it in ML
Each neuron computes a dot product; attention scores are dot products.
Don’t confuse it with
- times / dimension Ordinary multiplication — or, between sizes, 'by' as in a 3 × 4 matrix.
- Hadamard (element-wise) product Multiply matching entries and keep them as a vector/matrix — no summing.
- inner product A general 'multiply and sum' between two vectors; for ordinary vectors it's the dot product.
- composition Apply g first, then f to the result: (f∘g)(x) = f(g(x)).
- cross product (3-D) For two 3-D vectors, gives a vector perpendicular to both.
- tensor / outer / Kronecker product Combines two vectors into a matrix of all pairwise products (outer product), or two matrices into a bigger block matrix (Kronecker).