Vectorization (vec)
Stack a matrix’s columns into one long vector.
In ML papers
flattens a matrix into a column vector by stacking its columns one under the other. An matrix becomes a vector of length . It lets a paper treat a weight matrix as a single vector, for example to write a Fisher or Hessian matrix over all its entries.
It pairs with the Kronecker product (Tensor / Kronecker product) in the identity , which second-order methods such as K-FAC rely on.
How to type it
| LaTeX | Shows |
|---|---|
\operatorname{vec}(A) | |
\mathrm{vec}(A) |
A worked example
Column by column. Row-major code (NumPy's flatten) would give instead.
Common confusions
- is not the arrow accent , which just marks as a vector (Bold lowercase (vector)).