Skip to content
AI360Xpert
Glossary
Definition

Matrix

A rectangular grid of numbers addressed by two indices — rank 2, shape (m, n).

A matrix arranges numbers in mm rows by nn columns, written XRm×nX \in \mathbb{R}^{m \times n}. Row index first, column index second, always — the reverse convention does not exist and assuming it is a reliable source of bugs.

Two matrices dominate practice. A weight matrix maps one layer's width to the next, so its shape encodes the layer's input and output sizes. A batch matrix holds one example per row, so its first axis is the batch. Every dense layer in a network is a matrix multiplication between those two, which is why the shape rules are worth being fluent in rather than looking up.