Maths for ML / Notation

∣x∣|x|

absolute value

Brackets and normsBeginner

Say it “absolute value of x”

Distance from zero, always non-negative. For a set, |S| is the number of elements.

Example

∣−3∣=3|-3| = 3

In code

np.abs(x)  # |x| of a number
len(S)     # |S| of a set
torch.abs(x)

Where you’ll see it in ML

L1 loss, vocabulary size |V|.

Don’t confuse it with

Lessons that use it

← All 94 symbols