Maths for ML / Notation

log⁡x, ln⁡x\log x,\ \ln x

logarithm

FunctionsBeginner

Say it “log of x”

The inverse of exp: what power of the base gives x. In ML papers log almost always means natural log (base e).

Example

log⁡(ab)=log⁡a+log⁡b\log(ab) = \log a + \log b

Turns products into sums.

In code

np.log(x)
torch.log(x)

Where you’ll see it in ML

Log-likelihood, cross-entropy, log-softmax for numerical stability.

Don’t confuse it with

Lessons that use it

← All 94 symbols