Playground
Two ideas behind machine learning that you can poke at yourself. Everything runs right here in your browser: nothing you type is sent anywhere.
Gradient descent
Type a curve, pick where to start, and watch a ball roll downhill to the lowest point it can find. This is how AI models learn: take a small step in the direction that lowers the error, then repeat.
- Iteration
- 0
- x
- –
- f(x)
- –
- f′(x), the slope
- –
- Next step
- –
Think of the curve as a valley and the ball as you, blindfolded, feeling the slope under your feet. At every step you check which way is downhill (the slope, f′(x)) and move a little that way. The learning rate is how big that step is: too small and you crawl, too big and you leap right over the bottom. Training an AI model works the same way, just with millions of numbers instead of one x. Watch "Math is Art, Part 2: Gradient Descent".
Genetic algorithm
Type a phrase and watch 250 random guesses evolve toward it. Each generation, the best fifth of the guesses "breed", a few letters mutate at random, and the best guess so far is always kept.
Try 0 | Best: '' | Fit: 0.0%
Nobody tells the computer the answer. It just keeps the guesses that score best and mixes them, like breeding the fastest racehorses, and random mutations add new ideas. Over generations, good letters spread and the phrase appears. The same trick is used to design antennas, schedules and game strategies.