The Maths You Actually NeedLesson 39 of 76

Module 5 · Logarithms, information and the shape of a loss

What a log is, and why the axis got logged

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 1 of 10 in this chapter

This chapter’s goalCompute a cross-entropy and a KL divergence by hand from two small distributions and say which part of a training loss is irreducible, derive the squared-error and cross-entropy losses from a stated noise assumption, compute a softmax and its gradient for a given set of logits, and explain by the overflow limit of float32 why every library subtracts the maximum before exponentiating.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

A log counts multiplications

A logarithm answers one question: how many times must I multiply the base by itself to reach this number? log2(1024) = 10 because ten doublings reach 1,024. log10(1,000,000) = 6 because six tens do. That is the whole definition. Everything else is consequence.

Three bases matter in this field.

  • Base 2 counts doublings and gives answers in bits. log2(32000) = 14.97, so choosing one token from a 32,000-word vocabulary is about fifteen yes-or-no questions.
  • Base 10 counts orders of magnitude. A learning rate of 0.001 sits at log10 = -3.
  • Base e, written ln, where e = 2.71828. It is the one calculus prefers, because the slope of e^x is e^x. Every loss you will see from PyTorch is in this base, in units called nats.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘What a log is, and why the axis got logged’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/logarithms-from-scratch (Accessed: 27 November 2026).