HomeAll tracks · pricing · account
Python11 apps · Python, SQL & data
Start free Log in
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
← Deep Learning 0 / 11
Loading Python and the PyTorch engine in your browser… (the first time takes a moment, then it’s cached). You can start reading now.

Lesson 01Tensorsabout 12 min

A photo is a tensor

Every picture, sound and sentence a network sees is a grid of numbers. Meet the tensor: its values, its `shape` and its `dtype`.

You’ll usetorch.tensor · .shape · .dtype · .item()
  1. Datatensors, batches
  2. Modelforward
  3. Losshow wrong
  4. Backwardgradients
  5. Stepupdate weights
  6. Evaluatepredict, score

Watch the idea at work

Zoom into any picture on a screen and it breaks into squares, and each square is just a number: how much ink, how much light. Deep learning starts there. Before a network can learn anything about a picture, the picture has to become a **tensor**: a grid of numbers with a shape.

Predict first

A glyph is a small grey picture, 16 pixels wide and 16 pixels tall. How many numbers does it take to store one?

The mental modelA **tensor** is a grid of numbers of one type, with a **shape** that says how many numbers lie along each direction. A grey picture is a 2-D tensor (rows, columns); a single number is a 0-D tensor.
Why it mattersNetworks only do arithmetic. Pictures, sounds and words all reach a network as tensors, and most PyTorch errors you will ever see are about a shape that doesn't fit. Reading shapes is the first skill.

🧪 Move `row` to 0 and to 15: the edge rows of most glyphs are almost empty paper. Then open a few other glyphs with `pick`.