Everything below builds those tools from scratch, in the exact order the parent note uses them. No symbol appears before its plain-words meaning and its picture.
The little hat on y^ (read "y-hat") is a universal convention meaning "estimated version of y". It is not the truth; it is the model's opinion.
Round brackets () = open interval (endpoints excluded); square brackets [] = closed interval (endpoints included). This tiny distinction matters later: y^ can crawl close to 0 or 1 but is never allowed to touch them, because touching breaks the logarithm (§4).
Picture y^ as a slider from 0 to 1. If the slider sits at 0.9 the model is saying "I'm 90% sure the answer is 1." Look at the red marker: it can slide right up against the walls but the walls themselves are forbidden.
Why the topic needs it: the whole loss is a function of this one number. See Sigmoid function and Logistic Regression for where y^ comes from.
Because y is exactly 0 or 1, any expression multiplied by y or by (1−y) acts like a switch:
This is why the parent's Bernoulli formula y^y(1−y^)1−y collapses to a single case each time — the exponents 0 and 1 turn factors on and off (a1=a, a0=1).
Why the topic needs it: it lets one clean formula cover both label cases without an if statement.
In machine learning "log" with no base written means the natural logln, base e≈2.718. The choice of base only rescales the answer (natural log gives units called nats), so it never changes which model wins.
Why not just use the probability directly? Why introduce a new tool at all? Because we need a scoring rule with two specific shapes, and only −log delivers both:
As the correct-answer probability approaches 1, the cost should fall to 0. Indeed −log(1)=0.
As that probability approaches 0, the cost should explode to ∞, punishing confident mistakes brutally. Indeed −log(x)→∞ as x→0+.
No polynomial does this — you need the log's blow-up near zero.
Look at the red curve of −log(y^): flat and near zero on the right (you gave the right answer high probability → cheap), and rocketing up on the left (you gave it almost no chance → ruinously expensive). Trace the marked points: −log(0.99)≈0.01 vs −log(0.01)≈4.6.
Why the topic needs it:−log(prob of the true class)is the log-loss. Everything else is bookkeeping.
The model first computes a plain number z (a weighted sum, could be any value from −∞ to +∞). We must squash it into a valid probability in (0,1).
The red S-curve is the sigmoid. Notice it lives entirely inside the (0,1) band — that's why its output is a legitimate y^. The dashed line marks σ(0)=0.5, the point of maximum indecision.
One fact the parent uses without proof — the slope of the sigmoid:
σ′(z)=σ(z)(1−σ(z))=y^(1−y^)
Read σ′(z) as "the derivative — how fast σ rises as z increases." Its value is largest at z=0 (steepest in the middle) and near zero far out on either side (flat tails). This exact expression is the thing that magically cancels inside the gradient in the parent note.
Why the topic needs it:y^=σ(z) links the model's raw score to the probability the loss consumes. See Sigmoid function.
Why the topic needs it: the parent derives ℓ first (clean, single-case), then averages into J (what gradient descent actually minimizes — see Gradient Descent).