⊙ — element-wise product
Read "a times b, element-wise". Multiply two same-shaped vectors or matrices position by position. This is not matrix multiplication.
. The output has the same shape as the inputs. In NumPy and PyTorch it is a * b, while matrix multiplication is a @ b. It is also called the Hadamard product.
It appears wherever each feature gets its own scale: the learned gain in LayerNorm and RMSNorm, and the gate in SwiGLU, where one branch scales the other entry by entry. Some texts write for the same thing, though can also mean other kinds of product.
Example
First times first, second times second, third times third.
Where the course uses it
Related terms
- LayerNorm — layer normalizationRead "layer norm". It shifts and rescales each token's vector to have mean 0 and variance 1, then applies a learned scale and shift.
- GELU, ReLU, Swish — activation functionsThe nonlinearity applied inside the feed-forward block. ReLU sets negative numbers to zero; GELU and Swish do almost the same but with a smooth curve.
- Matrix multiplicationTwo matrices written side by side, like AB, are multiplied. Each entry of the result is a row of A dotted with a column of B. An (m×n) times an (n×p) gives an (m×p).