From one knob to attentionChapter 4 of 9

Chapter 4

Many knobs

So far the rule has looked at one thing: time. Real answers depend on many things at once. This chapter lets the rule look at several things, and gives it one knob for each.

By the end of this chapter, you will be able to

One thing is not enough

Our rider is planning bike rides, and wants to know how long each one will take. A good first guess: longer rides take longer. So let the rule look at the distance.

We do not need to set the knob by hand any more. The machine from chapter 3 has done it. Here is its best line.

Try itEach dot is one bike ride. The machine has already set the knob as well as it can. Look at the misses, then press the button.
0 min30 min60 min90 min120 min05101520253035how far the ride was (km)how long it tooktime = 3.2 × km

The best line still misses by up to 21 minutes. Look at the two rides of 20 km. Same distance, but one took 18 minutes longer. Distance alone cannot explain that.

In chapter 2 the misses were small, and came from a shaky hand on the stopwatch. These misses are different. They are big, and they have a cause. The rule is missing something it needs to look at.

No knob setting can fix that. The rule has one knob, on distance. It has nowhere to put what it knows about hills.

A knob for each thing

The fix is simple. Let the rule look at two things, and give each its own knob. One knob says how many minutes each kilometre costs. The other says how many minutes each hill costs.

Think of a sound mixing desk. Each instrument has its own knob, and the knob sets how much of that instrument goes into the song. Here, each knob sets how much of each thing goes into the answer.

Try itTurn the two knobs until the rule’s guess lands on the real time. Then do the same for the other ride, without spoiling this one.
20 km, no hills
distance20 km
×
1.0 min per km
=
20 min
hills0 hills
×
2.0 min per hill
=
0 min
add them up
real time: 50 min
20 min
time = 1.0 × km + 2.0 × hills

The guess is 30 minutes too short. This ride has no hills, so the hills knob does nothing here. Only the distance knob can fix it.

Read the desk from left to right. Each row takes one thing about the ride and multiplies it by its knob. That gives a share of the answer. Then the shares are added up.

Multiply each thing by its knob. Add up the results. That is the whole rule.

And ride 3 showed why this is worth doing. You set the knobs on two rides. They worked on a third ride you had not looked at. The knobs are not about those two rides. They are about riding: what a kilometre costs, and what a hill costs.

Let the machine set them

Two knobs were easy, because one ride was flat. Real rides are messier. There is wind, too. And we may not know in advance which things matter.

So let us be generous. We will give the machine four things to look at: the distance, the hills, the wind, and the number on the rider’s jersey. That last one is silly on purpose. A jersey number cannot change how long a ride takes. We want to see what the machine does with it.

The machine learns just as it did in chapter 3. It feels a slope for each knob, turns each knob a little downhill, and repeats.

Try itTwelve rides, four knobs. Press the button and watch the knobs. One of them is for something that does not matter. See what the machine does with it.
10 km · 0 hills · tailwind 5 · no. 76 min under
14 km · 3 hills · headwind 5 · no. 4224 min under
18 km · 1 hill · no wind · no. 1527 min under
20 km · 5 hills · tailwind 10 · no. 882 min under
22 km · 0 hills · headwind 10 · no. 2336 min under
25 km · 2 hills · tailwind 5 · no. 6113 min under
28 km · 4 hills · headwind 5 · no. 473 min under
30 km · 1 hill · no wind · no. 3733 min under
12 km · 5 hills · no wind · no. 993 min over
16 km · 2 hills · tailwind 10 · no. 501 min over
35 km · 3 hills · headwind 10 · no. 1277 min under
24 km · 6 hills · tailwind 5 · no. 7629 min under
distance1.0min per km
hills0.0min per hill
tailwind0.5min per km/h
jersey number0.50min per number

The knobs are set badly. A typical guess is off by about 36 minutes. Orange bars are the rule’s guesses. Dark marks are the real times.

What the knobs tell you

When the machine has finished, its knobs are worth reading. Each knob tells you something about the world.

A big knob means the thing matters a lot. The hills knob ends near 6. Each hill adds about 6 minutes. That is more than two extra kilometres.

A minus sign means the thing pushes the other way. The tailwind knob ends below zero. More wind at your back means less time, not more.

A knob at zero means: ignore this. The jersey knob ends at zero. Whatever the jersey number is, zero times it is still zero. So it adds nothing to the answer.

The machine learned what to pay attention to, and what to ignore. Remember this. It is a small version of the idea this whole article is heading for.

Two kinds of number

The rule now has two kinds of number in it, and it is easy to mix them up. Try using the finished rule.

Try itThe knobs are locked where the machine left them. This time, change the ride: how far, how many hills, how much wind.
26 km, 2 hills
distance26 km
×
2.5 min per km
=
65 min
hills2 hills
×
6.0 min per hill
=
12 min
tailwind5 km/h
×
−0.7 min per km/h
=
−4 min
add them up
74 min

The rule says about 74 minutes: 65 for the distance, plus 12 for the hills, minus 3 for the wind at your back.

Notice which numbers you moved. In the last figure, the rides stayed the same and the knobs moved. Here the knobs stay the same, and the ride changes.

The things going in change with every question. The knobs are set once, by learning, and then stay put. Setting the knobs is called training. After that, you just use the machine.

The shape of every rule

Step back and look at the shape of what we have built:

answer = knob × thing + knob × thing + knob × thing + …

It does not matter what the things are. Kilometres and hills. The size and age of a house. The brightness of each dot in a photo. Give each thing a knob, multiply, add, and let the machine set the knobs.

This shape is everywhere in machines that learn. The biggest ones are made of this one move, done millions of times. You will see it again in every chapter from here on.

What is still missing

This rule has a blind spot. It says every hill costs the same 6 minutes. The first hill, and the eighth. But by the eighth hill a real rider is tired, and slower.

A weighted sum cannot say that. Each knob gives one fixed price, however much of the thing there is. It is the straight line from chapter 1 again, just with more things going in. It can tilt, but it cannot bend.

The world is full of bends. The next chapter teaches the machine to make them.

You can now