Mark học AI

Video #39 · How AI learns · Part 2/7

What is loss? How AI knows how wrong it is

To learn, AI has to know how wrong it is. Like darts: the distance to the bullseye is a number that measures the miss.

Watch videoVideo in Vietnamese

How wrong?

Last time: AI learns by turning billions of knobs. But to turn them the right way, the machine has to know how wrong it is. So how is "wrong" measured?

EXAMPLE

Throwing darts

Picture throwing darts at a target. Hitting the bullseye is right. The farther you miss, the more wrong you are. The distance to the bullseye is a number that measures the miss.

LOSS

A number that measures being wrong

AI works the same way. The machine gives an answer and compares it with the right one. How far off it is becomes a number, called the error, or the loss function.

EXAMPLE

A photo of a cat

Show the machine a photo of a cat. It says: 70% dog. The loss is very big. Next time it says: 90% cat. The loss is much smaller.

THE GOAL

Push the number down

The whole learning process aims at one thing: push this error number as low as possible. Every time it turns the knobs, the machine checks whether the loss went up or down.

CAREFUL

You get what you measure

But the machine only optimizes exactly what's measured, nothing more. If essays are graded only by length, it will learn to write long, not better.

PART 3

Which way to fix it?

Now it knows it's wrong. But with billions of knobs, which way should it turn them? The answer is like walking down a mountain in the fog. See you in part 3.

This article is based on the video How AI knows how wrong it is from the Mark học AI channel. Watch the video (in Vietnamese) to see the animations.