Glossary term
Glossary term
Foundations
Expanding the shape of an operand in a matrix math operation to dimensions compatible for that operation. For example, linear algebra requires that the two operands in a matrix addition operation must have the same dimensions. Consequently, you can't add a matrix of shape (m, n) to a vector of length n. Broadcasting enables this operation by virtually expanding the vector of length n to a matrix of shape (m, n) by replicating the same values down each column.
Click the icon for an example.
See the following description of broadcasting in NumPy for more details.
Created for this library
An ML engineer uses broadcasting in NumPy to add a per-feature mean vector to a batch of examples without writing an explicit loop.
A computer vision team relies on broadcasting in PyTorch to apply per-channel normalization across a batch of images during preprocessing.
A finance analytics team uses broadcasting in pandas to compute price minus a rolling-window mean across thousands of instruments at once.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License