Margin · machine learning, by hand

You don’t learn this
by watching videos.
You learn it by hand.

Margin is a 16-session course where every idea lands twice: once in a lesson you read, once in a Lab where you write the code and it runs in your browser. Exercise zero is below. Yes, right here on the landing page.

Exercise 00Drag the line. Fit the dots.
loss = 11.68 · target < 1.00

That instinct — move the thing, watch the error, move again — is gradient descent. The entire course is turning it into code you write.

fig. 0 — least squares, by feelno installs · no account · this is the actual product
Worked notes

What you just did, on paper

1.

You moved two numbers

The line is y = wx + b. Dragging the handles changed the weight w and the bias b — the same two numbers a model tunes.

2.

A number graded you

The loss measured how wrong the line was, every frame. You steered by it without thinking. That number is the loss function — the heart of all training.

3.

You minimized it

Nudge, check, nudge again — done by a formula instead of a hand, that’s gradient descent. It trains everything from this line to ChatGPT.

The method

Every concept lands twice.

First — the lesson

Rolling downhill

Imagine standing on a hillside in fog. You can’t see the valley, but you can feel the slope under your feet. Step downhill. Re-check. Step again. The slope is the derivative; the stepping is learning.

then — the lab (runs in your browser)
def step(w, b, lr=0.1):
    dw, db = gradient(w, b)
    return w - lr*dw, b - lr*db

# the hillside, as three lines of numpy
▸ loss 4.218 → 0.392 → 0.041  ✓
Contents

16 sessions, five phases.

Figures

Some ideas you have to poke.

Alongside the sessions: standalone simulations. No progression, no score — just the machinery, with the cover off.

PrerequisitesWhat you need
  • a browser — this one’s fine
  • grade-10 algebra
  • about 30 minutes per session
  • a Python installlabs run right here
  • a GPUyour laptop is plenty
  • calculusderived when needed, in phase 2
Questions students ask
Do I need to know how to code?

A little helps, but Session 01 starts from the very first line of Python. If you can edit a formula in a spreadsheet, you can start.

How much math, honestly?

Grade-10 algebra gets you through phase 1. Derivatives show up in phase 2 and are built on the page when they do — nothing is assumed, nothing is skipped.

What happens when I get stuck?

Every Lab has a tutor that sees which step you’re on and nudges with a question — the way a good teacher does. It never hands you the answer.

Is it really free?

Yes. Margin was built for a school ML club and stays free while it grows. No card, no trial, no locked chapters.

Your turn.

Session 01 takes about thirty minutes and ends with your first running model. The line you just fit? You’ll teach a machine to do it.

Start Session 01 →free · in the browser · no setup