Interactive figures
Every figure in the track. Each one is a small experiment: drag, slide, and watch the numbers. The link under each figure takes you to the lesson that explains it.
Lesson 1 · How to learn here
Compare the presets "cram" and "spaced". Both use four reviews. The blue curve is the retention ; each yellow line is a recalled review, each magenta line a failed one; the violet dot is on day 60. Then click on the chart to place your own reviews, and try "too late". This is a simplified model, not a measurement: the numbers show a pattern, not real percentages.
Rate one card and watch the schedule. Each dot is one review: its position on the horizontal axis is the day of the review, its height is the interval chosen after it (log scale). The preset "forgotten on day 4" is the card of the worked example in section 4: after Again it returns in 10 minutes (magenta dot, low), then starts again at 1 and 3 days, now with ease 2.3. Press "New card" and predict each interval before you press a rating. The figure uses the same rule as the Review page.
Lesson 2 · Reading math notation
Guess the total, then press Step. Each step gives the index its next value, computes the term, and adds it to the running total; the yellow bar is the term just added. Try all five sums. For "mean", the sum is divided by at the end. For the double sum, watch each row: row adds up to .
Click a number, a row header or a column header. The readout gives the math name with indices from 1 and the Python index from 0. Rows are samples (blue tint), columns are features (orange tint), and the selection is yellow.
Drag the blue point to the top of the graph. The aqua dashed line is the maximum value (a height); the yellow marks on the horizontal axis are the argmax (the places). Try "a tie": the maximum is one number, but the argmax has two elements. Try "max at the end": the largest value is at the end of the interval. Then switch "Find" to min.
Pick an operation and find its region. Circle and circle sit in the universe ; the result is shaded yellow and listed in set notation. Try "": the region "in but not in " is empty. Try "disjoint": . For the union, check the rule .
Compare the two orders. The top row is (first ), the bottom row is (first ). The input is blue, the value between the machines is aqua, the output is violet. Change and the pair of functions; find an input where both orders agree. The last pair is a function and its inverse.
Lesson 3 · Python and NumPy for math
Pick a preset or type your own index (press Enter). The yellow cells are
selected; the panel prints the result, its shape, and whether it is a view. Compare A[1] (shape (6,))
with A[1:2] (shape (1, 6)): the same numbers, a different shape. The faint numbers are the negative
indices: -1 is the last row or column.
Choose an operation, an axis and keepdims. The yellow group is collapsed
first; then all groups collapse into the aqua result. Notice two things: with
axis=1 and no keepdims, the result is a 1-D array that NumPy prints as a row; with keepdims=True
it is a column of shape (3, 1). For argmax the result holds positions, not values.
Pick two shapes, guess the result shape, then press "Show the result". The table aligns the shapes
from the right. In the figure, a and b are drawn at the
result shape; faded cells with dashed borders are stretched copies. Each result
cell is the sum of the cells at the same place: the hundreds come from , the tens and ones from .
Try (3,4) + (3,): it fails, although both arrays have a dimension of size 3. A
magenta bar marks the dimension that breaks the rule.
Switch between * and @, then click a cell of the result (or press Next cell). The input cells
it uses turn yellow: one cell of A and one of
B for *, a whole row of A and a whole column of B for @. Choose "2×3 and 3×2":
@ works, * raises an error. Choose "1-D x and y" to see that x @ y is one number.
Press "Draw again" with a fixed seed, then switch to "no seed" and press it again. With a fixed seed, the first three numbers and the whole picture repeat exactly; without a seed they change every time. Move up: the histogram approaches the bell shape of the normal distribution, and the sample mean and standard deviation get closer to 0 and 1. This figure uses its own generator, so its numbers differ from NumPy's; the idea is the same.
Lesson 4 · Lines, powers, exp and log
Drag the two blue points. The orange line goes through both. The aqua triangle shows the run and the rise ; their ratio is the slope . The yellow dot is the intercept . Make the slope negative, then zero. Then put both points at the same : why does the formula fail?
Move one slider at a time, and predict before you look. The dashed blue curve is the base function , the orange curve is . The aqua arrow shows where one marked point of goes. Notice that moves the graph to the right, not to the left.
Drag the orange point along . Its mirror point on the violet curve follows; the aqua segment joins them across . Every exponential passes through , so every logarithm passes through . Try base , and then move to 1: why is there no ?
Switch the axes. The blue dots are , the orange dots are . The dashed lines are least-squares lines in the current axes; means a perfect line. Notice which data set becomes straight on semilog axes (slope ) and which on log-log axes (slope 3).
Start at with a linear -axis: (orange) seems to win and (violet) looks flat. Move past 60, then switch to a log -axis. The yellow lines mark where crosses (blue) and .
Lesson 5 · Sigmoid, softmax, log-sum-exp
Move and , and drag the blue point. The orange curve is . The yellow dot is the centre , where ; the aqua line is the tangent there, with slope . Predict first: what does do? Then move the point far to one side: the curve is flat there and its slope is almost 0 (a saturation warning appears).
Predict, then move. The orange bars are for the four logits . First move the slider "add to all": the logits change, the bars do not. Then make small (the bars become one-hot) and large (the bars become equal). Try "all negative": softmax works, but the naive ratio below the bars gives negative "probabilities".
Lower the temperature . The blue kinked curve is ; the orange curve is for . It always stays inside the yellow band , and the gap is largest at , where the two numbers are equal. The aqua tangent has slope : the slope of LSE is the softmax.
Step through the two columns. The naive column computes first and fails
(inf and nan in magenta). The stable column subtracts the max
first and gives the correct probabilities. Try "−1000, −1001, −1002"
(underflow) and "0, 1000" (the log-softmax row). Then choose "88, 89, 90" and switch to float32:
there the limit is 88.72, not 709.78 (the figure rounds each step with Math.fround to simulate float32).
Lesson 6 · A gentle tour of vectors
Drag the tips of (blue) and (orange). The violet arrow is the result, and the panel writes it entry by entry. Switch to : the violet arrow now runs from the tip of to the tip of (its dashed copy starts at the origin). In , move the slider below 0 and watch the arrow flip.
Move the slider from 0 to 1. The mix fades from
image to image . Below the images, is written as
64 numbers, one row of the image per line. Each pixel is one entry, so each entry of the mix is the same mix of two numbers.
The images are real samples from scikit-learn's load_digits (grey values 0 to 16).
Drag the tips of and and compare the two readouts: the sum of products and are always equal. The thick segment is the shadow of on the line of : aqua when , magenta when . Press right angle: the shadow disappears and the dot product is 0.
Drag the query (blue). Each orange point is a document, written as the counts of two words. The left table ranks the documents by cosine similarity and the right table by distance. The best match by cosine has a violet ring, and the best match by distance has an aqua ring. D1 and D2 point in the same direction: cosine gives them the same score, distance does not. Drag far out along that direction and watch only the distance ranking change.
Lesson 7 · Slope, derivative, gradient
Press Shrink h and watch the orange secant turn into the aqua tangent at the blue point. The panel computes the secant slope; its difference to the tangent slope shrinks with . Try a negative : the secant now uses a point on the left, and the slopes approach the same value. At the quotient is , which is not defined: the derivative is a limit, not a division by zero.
Move the zoom slider to the right. The window around gets up to 200 times narrower, and the blue curve and the aqua tangent line become one line. The magenta segment is the error of the linear approximation at the edge of the window. On the right, that error is plotted against on log–log axes. It follows the dashed line of slope 2: ten times smaller gives about 100 times smaller error.
Move the sliders and , and drag the figure to rotate it. The orange curve is the slice "hold "; the slope of its dashed tangent is . The aqua curve is the slice "hold ", with slope . The two slopes together form the gradient, the blue arrow on the floor. It lives in the input plane , not on the surface.
Drag the orange tip of the unit direction around the dashed circle. The slope of in that direction is ; the chart plots it against the angle of . Find the largest value: it is reached when points along the blue gradient, and it equals (the blue line in the chart). Press u along the contour: the slope is 0, and lies on the dashed tangent of the aqua contour line. Drag the black point to test other places.
Choose a preset under Try and watch the orange iterates on the blue parabola. The panel shows the factor . With zig-zag the factor is negative: the point jumps from side to side but still gets closer. At it is : the point flips between forever. Above 1 it diverges. Switch to 2-D: on the aqua contours of , the steep direction starts to zig-zag first. The chart shows at each step on a log scale.
Lesson 8 · Chance and data
Flip, then compare runs. Each line is one run of 10 000 flips (run 1 is blue). The aqua dashed lines are the band ; for large about 95 % of runs are inside it. Press New flips a few times: early on the runs disagree a lot, later they all stay near . The x-axis is logarithmic, so each step to the right is 10 times more flips.
Drag the blue dots. The violet triangle is the mean (the balance point) and the yellow diamond is the median. Each orange square has side , so its area is the squared deviation; the variance is the average area. Press Add outlier at 20 and watch the mean move but the median hardly move. Press Shift all +1: the mean moves, the variance does not.
Change the bin width . The blue bars are the histogram; the orange curve is the true density the samples came from. With the two peaks merge into one; with and the bars are mostly 0 or 1 sample and look like noise. Switch between count and density: the shape stays, the y-axis changes, and in density mode the bar areas add up to 1.
Drag and , then change . The yellow area under the orange curve is . Use the presets , , to see 0.6827, 0.9545 and 0.9973. When you move or , the blue handles keep their z-scores and the area does not change. With the peak is near 4, above the dashed line at density 1.
Increase the number of dice . The blue bars are the exact distribution of the mean of dice; the orange curve is the normal curve with the same mean and standard deviation . One die is flat, two dice give a triangle, and from about 5 dice the bars follow the curve closely. The loaded die is skewed: it needs more dice before the bars look normal.
Lesson 9 · Reading and writing proofs
Choose a claim, then switch the form. Blue dots are numbers where the hypothesis holds; an orange ring means the conclusion holds; a magenta cross is a counterexample. For "divisible by 4 ⇒ even" every blue dot has a ring. Switch to the converse: the numbers 2, 6, 10, … become counterexamples. Switch to the contrapositive: the counterexamples are always the same as for the original claim.
Predict, then press Push. A domino turns blue when its statement is proved. The yellow arrow is the base case; a magenta × between two dominoes is a missing step. Try no base case (nothing falls), step fails at 1 → 2 (only the first falls) and the preset for , where the base case is .
Move the slider . The blue staircase has squares; the orange turned copy has the same number. Together they fill the rectangle. Switch to induction step: the yellow column of squares turns the staircase for into the staircase for .
Pick a claim and press Scan. Each cell is one case: aqua means the claim holds there, magenta is a counterexample. Click a cell to see the computation. For "" and "6 divides " the scan finds nothing; the widget then shows the real proof, which covers every case and not only the ones in the grid.