Lesson 0.1

What a Framework Actually Is

Before any code, the mental model. A deep learning framework is a machine that does four jobs. Once you see them, the rest of the course is just building each one.

concepts 10 min read

A machine that remembers its own arithmetic.

Picture a calculator that does something ordinary calculators don't: every time you ask it to add or multiply, it quietly writes down what it just did and what it used. After a long calculation, it can answer a question that's normally hard to answer, "if I nudged this one number a tiny bit, which way would the final answer move, and by how much?"

That question is the whole game in deep learning. A model is a giant calculation with millions of adjustable numbers (the "weights"). Training means asking, over and over, "which way should each weight move to make the answer a little less wrong?" A framework is the machine that answers that question automatically, because it remembered every step.

PyTorch, TensorFlow, JAX, tinygrad. Under the branding, they are all this same machine. They run the steps forward, remember them, and hand you the answer to the nudge question. monktensor is that machine too, built on single numbers first so you can watch every step.

The four jobs.

Strip away the size and the GPUs and every framework does exactly four things, in order:

1

Represent the computation.

Let you build a calculation out of small pieces, add, multiply, a squashing function, and quietly record how the pieces connect. This record is the computation graph (Unit 1).

2

Run it forward.

Push numbers through the graph and get a result out, a prediction, and then a single number that says how wrong the prediction was (the loss). This is the forward pass.

3

Figure out the gradients, automatically.

For every input number, compute "how much does the loss change if I wiggle this one?" The framework does this itself, exactly, by walking the recorded graph backward. This is automatic differentiation, or backpropagation (Unit 2). It is the part that feels like magic, and it isn't.

4

Update the numbers.

Nudge each weight a small step in the direction that lowers the loss, then do the whole thing again. This is gradient descent (Unit 4). Repeat enough times and the calculation turns into something that has "learned."

That's the entire arc of this course: represent โ†’ run โ†’ differentiate โ†’ update. It's the loop on the home page, and it's the loop inside every framework on earth.

Why "remembering the steps" is the trick.

Here is the smallest possible version of the magic. Suppose you ask the machine to multiply two numbers:

a = 2,   b = 3  →  c = a × b = 6

Drag the a bar

c is always b = 3 times as long, so it grows as fast

1.50 × 3 = 4.50
a1.50
c = a × b4.50

that fixed ratio, how much c moves per step of a, is the derivative dc/da = b

Now the nudge question: if a grows by a tiny sliver, how much does c grow? Since c is a × b and b is 3, every sliver added to a shows up tripled in c. So the answer is 3, which happens to be b. The machine didn't do any calculus to know this; it just remembered "c came from multiplying a by b," and the rule for a multiply is "each input's influence is the other input."

That number, "how much the output moves when one input wiggles", is a derivative. The framework's superpower is computing it for every input in a huge calculation, automatically, by remembering each small step and the simple rule that goes with it. The next three lessons make "derivative," "gradient," and "the rule for chaining steps" precise.

What this framework is NOT (yet).

Not about GPUs or speed.

We start with single numbers, not big arrays. Slow is fine. The point is to see every operation. Speed is a Unit 5 concern.

Not a collection of ready-made models.

No pretrained networks, no "import a chatbot." You're building the layer those things are made of.

Not magic.

By the end you'll have computed a gradient by hand and checked the machine against your own arithmetic. Nothing here stays mysterious.

Key takeaways

1

A framework is a machine that does four jobs: represent a computation, run it forward, compute gradients automatically, and update the numbers.

2

The hard, valuable job is the third one: automatic differentiation. It works by remembering every small step and applying a simple rule to each.

3

A derivative is just the answer to "if I wiggle this input a tiny bit, how much does the output move?" The whole course makes that precise and then automatic.