Getting your lesson ready…

0
Reading your lesson…
0:00 / 0:00

What happens when micrograd adds two Values?

A lesson on karpathy/micrograd, a GitHub repo. Computing, college level.

In micrograd, a Value holds one number.

When you add two Values, you do not just get a plain number back.

The add step makes a brand new Value.

Its data is the sum, self.data + other.data.

The new Value also keeps its two inputs in a list called _children.

It saves the sign '+' as _op, a note of which step made it.

Multiply works the same way, saving '*'.

Questions in this lesson