Skip to content
Tactiverge

Learning Rooms/○ Level 3 · Innovator/Computing and algorithms

Machine Learning & Artificial Intelligence: Crash Course Computer Science #34

CrashCourse · Length: see YouTube · captions on YouTube · nothing loads until you press play

By the end you can…

  • Distinguish training from inference and explain why only inference must run on the device.
  • Count multiply-accumulate operations (MACs) for dense and convolutional layers.
  • Estimate a model's latency from MACs and a device's MAC rate, and list its memory needs (weights and activations).
?Predict▶Watch✓Practise⚙Build

Watch it all: no segment has been checked by hand for this video yet.

1.Predict before you press play

A layer connects 128 inputs to 64 outputs. How many multiplications does one inference through it need (ignoring biases)?

Pick one before you press play. A wrong guess is fine: it is what makes the video stick.

2.See the idea first

Play with this diagram for a minute (borrowed from the lesson “The perceptron: one neuron draws one line”, on the same idea). It gives you something to hang the video on.

Loading the interactive…

Can't use the diagram? Read a description instead

The perceptron diagram plots six points on a 0–5 grid: class 0 (circles) at (1, 1), (2, 1) and (1, 3); class 1 (squares) at (3, 4), (4, 2) and (4, 4). Weights start at zero. Each step shows one example; if it is misclassified the weights and bias change by η(t − y)x and the decision line moves. The readout gives the weights, the bias and how many points are misclassified; on this set it reaches zero. On the XOR set ((1, 1) and (4, 4) class 0; (1, 4) and (4, 1) class 1) at least one point is always wrong.

3.Watch, actively

A plain introduction to classifiers and neural networks, enough context to reason about what inference on a small device must compute.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Watch for…

  • → Notice the difference between learning the weights from labelled data and simply using them to classify a new input.

Pause whenever you like. Rewatching a hard minute is a good habit, not a failure.

Can't stream it? Read the idea instead

A classifier learns a rule from labelled examples, then applies it to new data. Training adjusts many parameters and is expensive; inference, using the trained model, is cheaper but still costs a fixed amount of arithmetic for every input, which matters on a small device.

What the video covers (our own note, written when we verified it): A plain introduction to classifiers and neural networks, enough context to reason about what inference on a small device must compute.

Written by Tactiverge in our own words, not a transcript. The full lesson below explains the idea without the video.

Read it instead

Jot down one thing that surprised you and one question you still have.

Private: saved only on this device, never sent to Tactiverge.

4.Practise what you just saw

These come from the lesson that use this video and are checked on the server. Wrong answers get a hint and another try.

Practice 1 · a fresh version every time

A network has two fully connected layers: 784 inputs → 16 hidden units → 2 outputs. How many multiply-accumulate operations (MACs) does one inference need (ignore biases and activations)?

MACs

Practice 2

Which phase normally runs on a battery-powered sensor?

Practice 3

A model needs 3,000,000 MACs. The core does 2 MACs per cycle at 80 MHz. Ignoring memory stalls, what is the latency in ms?

ms

Practice 4 · a fresh version every time

A neural network has 600000 weights stored at 16 bits each. How many kilobytes (1 KB = 1024 bytes) do the weights occupy?

KB

6.Where engineers use it

A typical keyword-spotting model for microcontrollers has tens of thousands of weights and a few million MACs per second of audio, small enough to run continuously on a coin-cell-friendly chip.

From the applied view in the lesson Training versus inference: counting the cost. Checked by automated tests only.

7.Build something with it

Follow-up project

Design (on paper) a classifier for 3-axis accelerometer gestures sampled at 50 Hz in 2 s windows. Choose layer sizes, count MACs and weights, and check it against a budget of 100 KB flash, 32 KB RAM and 10 ms on a 64 MHz core doing 1 MAC per cycle. State every assumption.

Open BUILD 008: Create a Virtual Computer →

Where this video lives

In the course catalogue: AIP-520 Embedded machine learning

The video is by CrashCourse, embedded from YouTube with privacy-enhanced mode and never autoplayed. The room around it (prompts, notes, practice, projects) is Tactiverge's, written with AI assistance and checked by automated tests only.