3. Training & Optimization

Cost Function (பிழையின் அளவு / Measuring the Error)

Let's ask Paati to taste the coffee! (பாட்டிட்ட காபி கொடுத்து மார்க் கேப்போமா!)

Technical Meaning: இழப்புச் சார்பு (Izhappuch Saarbu) - A formula that calculates how wrong the AI's predictions are.

The Core Idea

A Cost Function (also called a Loss Function) is a mathematical formula that calculates exactly how "wrong" an AI model's prediction is compared to the actual true answer. The entire goal of training an AI model is to minimize this cost down to zero.

The Origin Story

If you want a machine to improve, it needs a way to measure its own stupidity. You can't just tell a computer "you did a bad job." It needs a precise number. The Cost Function aggregates the errors of all predictions in a batch and outputs a single number. A high cost means the model is performing terribly. A low cost means the model is highly accurate.

The Tamil Analogy

Imagine the difference in taste between your grandmother’s authentic filter coffee and the coffee you just made.

Your grandmother tastes your coffee and gives you feedback.

  • If it has way too much sugar, she gives you a "Cost" of 80 (Very Bad).
  • You try again. If it is just slightly watery, she gives you a "Cost" of 20 (Better, but not perfect).
  • You keep trying until the taste perfectly matches hers, and she gives you a "Cost" of 0 (Perfect).

The Cost Function is essentially the grandmother tasting the AI's output and scoring how far away it is from the perfect, expected result!

Try It Yourself

Filter Kaapi Cost Function

Adjust the parameters to minimize the Cost (Error). The goal is Cost = 0.00!

👵
Paati's Reaction
Waiting to taste...