How to Train
Your AI 🧠

THE 4 STEPS TO INTELLIGENCE

SCROLL TO START â–¼

1. The Guess (Forward Pass)

Meet Mini-Brain. It has never read a book. Its internal "knobs" (parameters) are set to random numbers.

We feed it input: "The capital of France is..."

SIMULATION
Waiting for input...

Lesson: Without training, the data flows through random connections, resulting in garbage output.

2. The Scoreboard (Loss)

That was embarrassing. We wanted "Paris". We need to measure exactly how bad that guess was using a Loss Function.

INTERACTIVE MATH
Loss = -log(10%)

Drag the slider. Low confidence in the correct answer = HUGE Penalty.

ERROR: 2.30
We use -log(probability). If the AI is 99% sure (0.99), the score is near 0. But if it's only 1% sure (0.01), the score skyrockets to 4.6. This forces the AI to be confidently right.

3. The Blame Game (Backward)

The Loss is high. Who is to blame? We need to find which internal parameters caused the error.

This is the Gradient. It tells us: "If I wiggle this parameter, does the Loss go up or down?"

MINI-GAME

Find the sweet spot (lowest error) for this single parameter.

Slope (Gradient): -16
In a deep network, the error at the end depends on the layer before it, which depends on the layer before that. We calculate gradients backward from Output to Input using Calculus (The Chain Rule).

4. Level Up (Optimization)

We know the error (Loss). We know the direction to fix it (Gradient). Now, we take a step to update the brain.

TRAINING LOOP
Intelligence Lvl: 0 Target: "Paris"
AI says: "Toaster" (Conf: 1%)

By repeating this loop millions of times, the random numbers tune themselves into a structure that "understands" capitals.

End of Simulation.