Scalar
A single number with no direction, used to scale vectors and matrices.
- Contrasts with vectors (1D) and matrices (2D).
- Multiplying a vector by c stretches/shrinks it.
- Negative c flips direction.
When to use: Any single-value quantity: learning rate, temperature, regularization weight, loss value.
Example: np.array(3.5) is a 0-D scalar. lr · gradient is scalar-vector multiplication.