absolute value
Say it “absolute value of x”
Distance from zero, always non-negative. For a set, |S| is the number of elements.
Example
In code
np.abs(x) # |x| of a number
len(S) # |S| of a settorch.abs(x)Where you’ll see it in ML
L1 loss, vocabulary size |V|.
Don’t confuse it with
- norm The length or size of a vector. The subscript says which kind: ‖·‖₂ is straight-line length, ‖·‖₁ is the sum of absolute values.
- determinant One number that says how much A scales area/volume. Zero means A squashes space flat and has no inverse.
- vertical bar — many meanings Context decides: 'given' in probability, 'such that' in set-builder, 'divides' in number theory. Two bars ‖ mean a norm or KL divergence.