aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 2. Mathematical Foundations
Lesson 4 of 13 9 min · 159 words

Matrix multiplication

Composing linear maps; inner dimensions must match.

The product of and is with : entry is the dot product of row of with column of . The inner dimensions must match ( and ).

Matrix multiplication is not commutative — in general, and may not even be defined. It is associative, , and .

A matrix is a linear map: transforms vector . Multiplying matrices composes maps — first apply , then . This is why a neural network without activation functions collapses to a single matrix: .

Predicting for a whole dataset at once is one matrix product: , with of shape and of shape . This vectorisation is why GPUs make ML fast.

Formula to remember

Lp norm

p = 1 Manhattan, p = 2 Euclidean, p → ∞ max-norm.

Quick check · +5 XP

Multiplying a (2 × 3) matrix by a (3 × 4) matrix gives…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser