コンテンツへスキップ

この動画とテキストは英語です。

Neural networks: layers of tiny calculators passing signals on

AI 101 #03

A neural network is layers of simple neurons passing numbers forward. See what one neuron really computes, and why layers solve what a single line cannot.

詳しく

What a neural network is

A neural network is a stack of very simple calculators, called neurons, arranged in layers. Each neuron takes a few numbers in, gives each one an importance (called a weight), adds them up and passes a single number on. The next layer does the same with those results, and so on, until the last layer gives the answer. The name comes from a loose resemblance to brain cells, not from any real copy of a brain.

What the video shows

The short opens on brain cells firing, the loose inspiration, which then turn into the neurons of a network with four layers. A picture of a cat breaks into pixels, the tiny dots of colour that make up an image, and those pixels feed the first layer. The signal travels forward layer by layer, some connections stronger than others, until the last layer gives the answer. That layer has one neuron for "cat" and one for "dog", and the cat one wins.

An everyday example

Imagine how a football club might decide whether to sign a young player. Each local scout watches a few things, such as speed, passing and stamina, and boils them down to one score. The chief scout reads those scores, trusting some scouts more than others, and writes a short verdict. The head coach reads the verdicts and says sign or pass. Nobody in the chain sees everything, yet together they reach a decision. A neural network works in that spirit: each layer turns the previous layer's output into something a bit more useful, and how much each one trusts the others is the weights.

How it works

Inside one neuron there are only three steps:

  1. Multiply each input by its weight and add everything up.
  2. Add one extra adjustable number, the bias, which shifts the total up or down.
  3. Squash the result into a fixed range. The course's version keeps it between -1 and +1.

A layer is just several neurons side by side, and a network is just several layers in a row. In our free course, the code for all of it fits in a few short blocks.

The course then gives the network a test that a single neuron is known to fail. The task: say "yes" if one switch is on and the other is off, and "no" if they match, both on or both off. Drawn on a square, the two "yes" cases sit on opposite corners, so no single straight line can separate them, and a lone neuron can only ever draw one straight line.

A tiny network solves it. It has two inputs, a middle layer of two neurons (called hidden, because you never see its output directly) and one output neuron: nine adjustable numbers in total. Training finds those nine numbers automatically, and progress is not smooth. The error score starts at about 4.16 and barely moves for the first fifty steps. It dips to about 3.5 by step 100, then drops to about 0.04 by step 200, and all four cases come out right.

A common misconception

"Inspired by the brain" does not mean "works like a brain". The basic unit goes back to early research by McCulloch and Pitts and by Rosenblatt, whose perceptron paper put the brain in its title. What survived from that work is the shape: weighted inputs, added up, then a cut-off or a squash at the end. Each neuron is plain arithmetic. The power comes from wiring many of them together in layers.

Why it matters

In the switch test, the last neuron still just draws a straight line. What changed is the hidden layer in front of it, which rearranges the inputs so that one straight line is finally enough. That is the core reason networks have layers: each one reshapes the data so the next step becomes easier. How the weights get tuned in the first place is a separate idea, training.

Learn it step by step in Chapter 5 of our free course AI From Scratch: Backpropagation From Scratch: The Engine, Then the Network.

画面上

Loosely inspired by the brain. Layers of tiny neurons. Each passes a signal forward. The last layer gives the answer.

こちらでも

無料コース第5章をもとに、AIの支援を受けて作成したテキストです。