DEEP LEARNING LESSON 1 FOUNDATIONS

How Deep Learning Learns

A Deep Learning model learns by looking at examples, making predictions, measuring its mistakes, and adjusting its internal weights. This process is repeated many times until the model becomes better at making predictions.

The simple idea

Deep Learning learns through a repeated cycle: make a prediction, calculate the error, adjust the model, and try again.

How Does Deep Learning Learn?

A neural network starts with weights that do not yet produce accurate predictions. During training, the network gradually changes those weights.

Training Data
Prediction
Calculate Error
Update Weights
Better Prediction

This cycle is repeated again and again while the model is being trained.

Simple Example: Predicting a Student's Result

Suppose we want a neural network to predict whether a student will pass an exam.

We provide information such as:

Hours Studied
Attendance
Previous Score

The correct answer is known from the training data. For example, the student actually passed.

Student Data
Neural Network
Prediction: Pass

If the prediction is wrong or not confident enough, the network calculates how much it needs to improve.

Step 1 — Give the Model Training Data

The first step is to provide examples containing inputs and their correct answers.

Example Training Data

8 Hours
90% Attendance
Score: 85
Pass
2 Hours
55% Attendance
Score: 45
Fail

The network uses many such examples to learn the relationship between the inputs and the result.

Step 2 — Make a Prediction

The network takes the input values and passes them through its layers.

Input
Hidden Layers
Prediction

At the beginning of training, the prediction may be very inaccurate because the network has not learned the correct patterns yet.

Example

Correct answer: Pass

Model prediction: Fail

The model has made a mistake. It needs to learn from that mistake.

Step 3 — Measure the Error

The model compares its prediction with the correct answer. A mathematical function called a loss function measures how wrong the prediction was.

Correct Answer
+
Model Prediction
Loss

A smaller loss generally means the model's prediction is closer to the desired answer.

Think of loss as a mistake score

If the model makes a large mistake, the loss can be large. If the prediction is close to the correct answer, the loss can be smaller.

Step 4 — Update the Weights

The network uses the error information to determine how its weights should change.

Loss
Gradients
Update Weights
Improve Model

This is where concepts such as backpropagation and optimizers become important. We will study those concepts in detail later.

Step 5 — Repeat the Process

The model does not learn everything from one example. It processes many examples and repeats the learning process multiple times.

Predict
Measure Loss
Update
Predict Again
Improve

After many updates, the model can gradually learn useful patterns from the training data.

What Happens When the Model Sees the Data Many Times?

During training, the model can process the training dataset multiple times. One complete pass through the training dataset is called an epoch.

Simple Example

Training Dataset
Epoch 1
Epoch 2
Epoch 3

The model can continue improving its weights as it processes the data across multiple epochs.

Example: Learning to Recognize Cats

Imagine training a neural network with many images labeled as either cat or not cat.

Cat Image
Neural Network
Prediction
Compare With Label
Update Weights

At first, the network may make many mistakes. As training continues, it can learn useful visual patterns that help it distinguish cats from other objects.

What Does the Model Actually Learn?

The model does not learn a simple list of instructions such as "if this happens, do that."

Instead, training changes the numerical values inside the neural network, especially its weights and biases.

Training Examples
Weight Updates
Learned Patterns
Better Predictions

These learned numerical parameters allow the network to recognize relationships and patterns in new data.

Important

Learning does not mean the model understands data like a human. It means the model adjusts its parameters so that its predictions become more accurate according to the training objective.

Complete Learning Process

Training Data
Prediction
Loss
Backpropagation
Weight Update
Repeat

This cycle is the basic idea behind how a neural network learns during training.

QUICK CHECK

Check Your Understanding

How does a Deep Learning model learn?
It makes predictions, measures errors, and adjusts its internal parameters repeatedly.

What is loss?
Loss is a numerical measure of how far the model's prediction is from the desired answer.

What changes during training?
The model adjusts numerical parameters such as weights and biases.

Why are multiple training steps needed?
One prediction is not enough to learn useful patterns. The model improves through repeated examples and updates.

NEXT TOPIC

A Simple Deep Learning Example

Now we will put these ideas together with a simple Deep Learning example that shows how the pieces work together.