In the previous lessons we saw what deep learning is, its history and its applications. The time has come to open the box and look inside: what is a neural network made of? In this lesson you will meet the artificial neuron and its components (inputs, weights, bias, activation), see how neurons are organized into layers, learn what "training" a network really means, and pick up the essential vocabulary you will use throughout the course: epoch, batch, parameters, and the training, validation and test datasets. All at a conceptual, intuitive level, with analogies and no heavy math: the formalization will come in module 2. Mastering this vocabulary now will let you follow the rest of the course without stumbling.
Contents
- The artificial neuron: the basic building block
- Inputs, weights, bias and activation, one by one
- From neurons to networks: layers
- What does it mean to "train" a network?
- Essential vocabulary: epoch, batch, parameters
- The three datasets: training, validation and test
- A minimal code example
The artificial neuron: the basic building block
An artificial neuron is a very simple computing unit that does three things:
- Receives several input numbers.
- Combines those numbers, giving some more importance than others.
- Emits a single output number.
That's all. The power of deep learning does not come from each neuron being clever (it isn't: it is a tiny calculator), but from connecting thousands or millions of them in layers, as we saw with the hierarchy of representations in lesson 01-01.
Analogy: think of a neuron as a member of TecnoMarket's purchasing committee deciding whether to restock a product. They receive several pieces of data (this week's sales, units in the warehouse, whether a marketing campaign is coming up), give each piece a different importance based on their experience, add it all up mentally and issue an opinion: a number between "definitely restock" and "don't restock". The full committee (the network) combines the opinions of many members to reach far more refined decisions than any individual member could.
Inputs, weights, bias and activation, one by one
Let's look at the four components using the "should I restock?" neuron as an example:
| Component | What it is | In the committee analogy |
|---|---|---|
| Inputs (x) | The numbers the neuron receives | The data: weekly sales, current stock, upcoming campaign (yes=1/no=0) |
| Weights (w) | One number per input indicating how much it matters and in which direction | The importance the committee member gives each piece of data: perhaps sales weigh heavily (+), high stock weighs against (−) |
| Bias (b) | An extra number that shifts the result, independent of the inputs | The member's predisposition: a cautious one demands a lot of evidence before saying "yes"; an impulsive one says "yes" with little |
| Activation | A function that transforms the sum into the final output, introducing non-linearity | The way the opinion is expressed: they don't say "sums to 7.3", they say something bounded and interpretable, like "97% in favor" |
The internal calculation, in intuitive form:
That is: multiply each input by its weight, add everything up, add the bias and pass the result through the activation function.
Two key ideas to hold on to:
- The weights and the bias are what the network learns. The inputs come from the data; the weights and biases start with random values and are adjusted during training. When someone says a model "has 7 billion parameters", they are talking about its weights and biases.
- The activation keeps everything from being a mere sum. Without it, no matter how many layers you stack, the network could only learn linear relationships (straight lines), and the real world is full of curves. There are several activation functions (ReLU, sigmoid...) with different properties; we will study them in detail in lesson 02-02 — for now it is enough to know what they are for.
From neurons to networks: layers
Neurons are organized into layers, and layers are connected in a chain. There are three kinds:
- Input layer: it computes nothing; it simply receives the data. It has one "slot" per input variable (or per pixel, if it is an image).
- Hidden layers: the intermediate layers, where the progressive transformation of the data happens. They are called "hidden" only because we do not directly see their inputs or outputs from the outside. Having several hidden layers is exactly what makes a network "deep" (lesson 01-01).
- Output layer: it produces the final answer. Its shape depends on the task: one neuron per category if we are classifying (one for "laptop", another for "coffee maker"...), or a single neuron if we are predicting a number (units to be sold).
Let's see it with a mini-model for TecnoMarket that predicts whether a customer will buy (yes/no) from three pieces of session data:
graph LR
subgraph Input
X1[Minutes on the site]
X2[Products viewed]
X3[Registered customer]
end
subgraph "Hidden layer 1"
H1((n1))
H2((n2))
H3((n3))
H4((n4))
end
subgraph "Hidden layer 2"
G1((n5))
G2((n6))
end
subgraph Output
Y((Will they buy?))
end
X1 --> H1 & H2 & H3 & H4
X2 --> H1 & H2 & H3 & H4
X3 --> H1 & H2 & H3 & H4
H1 --> G1 & G2
H2 --> G1 & G2
H3 --> G1 & G2
H4 --> G1 & G2
G1 --> Y
G2 --> Y
Notice that each neuron in a layer connects to all the neurons in the next one (which is why these layers are called "dense" or fully connected), and every arrow in the diagram is a weight the network will have to learn. Count the arrows: 3×4 + 4×2 + 2×1 = 22 weights, plus 7 biases (one per computing neuron) = 29 parameters. In real networks this number shoots up into the millions: the mechanism is identical, only the scale changes.
What does it mean to "train" a network?
Here lies the conceptual heart of deep learning. Training means adjusting the weights and biases, little by little, so that the network's outputs get closer to the correct answers for the examples.
The cycle, from a bird's-eye view:
- Prediction: the network is given an example whose answer we know (a customer session that we know ended in a purchase).
- Measuring the error: what the network said ("30% probability of purchase") is compared with reality ("they bought"). The difference is summarized in one number: the error.
- Adjustment: the weights and biases are modified slightly in the direction that would have reduced that error.
- Repetition: this is repeated with thousands of examples, thousands of times. The errors keep dropping and the network keeps "tuning in".
Analogy: it is like adjusting the knobs of an unfamiliar shower. You turn on the faucet (prediction), notice the water comes out cold (error), turn the knob a little toward the red (adjustment), and try again. Nobody gave you the shower's manual: you reach the perfect temperature through trial, error measurement and correction, not in one jump but through small adjustments. Now imagine a shower with 29 knobs (our mini-model)... or with millions: that is why an automatic, systematic procedure is needed.
That automatic procedure exists and has two named pieces: the loss function (how the error is measured, lesson 02-04) and backpropagation with its optimizer (how to work out which way to turn each knob, lesson 02-03). In this module the intuition is enough: training = measuring the error and correcting the weights, in a loop.
One important nuance: the goal is not to memorize the training examples, but to generalize: to get it right on new examples the network has never seen. This motivates the dataset split we will see two sections from now.
Essential vocabulary: epoch, batch, parameters
These terms will appear in every lesson of the course and in any documentation you read:
| Term | Meaning | Example with TecnoMarket |
|---|---|---|
| Dataset | The set of examples you work with | 50,000 product photos already labeled with their category |
| Example (sample) | An individual case: input + correct answer (label) | One specific photo + the label "coffee maker" |
| Parameters | The weights and biases the network learns | The 29 numbers of our mini-model |
| Batch | A small group of examples processed together before each weight adjustment | Instead of adjusting photo by photo, they are processed 32 at a time and the adjustment uses the batch's average error |
| Epoch | One complete pass through the entire training dataset | With 50,000 photos and batches of 32, one epoch is 1,563 adjustments |
| Hyperparameters | The settings decided by the human, not the network: number of layers, batch size, number of epochs... | You decide to train 10 epochs with batches of 32; the network decides its 29 parameters |
Why batches instead of the whole dataset at once (or one example at a time)? Quick intuition: processing the whole dataset for each adjustment is slow and memory-hungry; adjusting on a single example makes the adjustments very erratic (each individual photo "pulls" in a different direction). The batch is the practical middle ground: frequent but stable adjustments. The finer details belong to lesson 02-04.
And how many epochs? As many as it takes for the error to stop dropping... without overdoing it. If you train too long, the network starts to memorize the examples instead of generalizing (a phenomenon called overfitting, which we will cover in depth in lesson 05-04). Catching it in time is precisely the job of the validation dataset.
The three datasets: training, validation and test
You never use the whole dataset for training. It is split into three parts with different roles:
| Dataset | Typical % | What it is for | Academic analogy |
|---|---|---|---|
| Training (train) | 70-80% | Adjusting the weights: it is the only thing the network "studies" | The textbook exercises you study with |
| Validation | 10-15% | Checking during development whether the network generalizes, and choosing hyperparameters | The practice exams you take while studying |
| Test | 10-15% | Final evaluation, with data never used in the process; you look at it exactly once, at the end | The official exam |
Why this discipline? Because evaluating the network on the same data it trained on is fooling yourself: it may have memorized it. It is like assessing a student by asking exactly the exercises they have already done: they would score a perfect mark without having understood anything. And the test set is kept untouched because, if you use it many times to make decisions, you end up (indirectly) fitting the model to it as well, and you lose the only honest measure of how it will perform in the real world.
For TecnoMarket: of the 50,000 labeled photos, 40,000 would go to training, 5,000 to validation and 5,000 to test. When we tell management "the classifier is 94% accurate", that 94% must come from the test set, not from training.
A minimal code example
To ground the vocabulary, here is what the definition of our mini-model looks like in Keras (TensorFlow's high-level API). You do not need to run it or understand it line by line yet: it is only so you can see that the concepts in this lesson translate almost literally into code. In lesson 01-05 we will set up the environment to run code, and in module 2 we will build and train a real network step by step.
from tensorflow import keras
# Define the network from the diagram: 3 inputs -> 4 neurons -> 2 neurons -> 1 output
model = keras.Sequential([
keras.layers.Input(shape=(3,)), # input layer: 3 data points per customer
keras.layers.Dense(4, activation="relu"), # hidden layer 1: 4 neurons
keras.layers.Dense(2, activation="relu"), # hidden layer 2: 2 neurons
keras.layers.Dense(1, activation="sigmoid") # output: probability of purchase (0 to 1)
])
model.summary() # shows the layers and counts the parametersPoints to notice (without going deep yet):
- Each
Dense(...)line is a layer of neurons fully connected to the previous one; the number is how many neurons it has. activation=is the activation function of each layer (the namesreluandsigmoidwill be explained in 02-02).model.summary()prints the layer table and the parameter count: for this network, 29, exactly the ones we counted by hand on the diagram (16+2 from the first hidden layer, 8+2... 22 weights + 7 biases in total).
If the count from summary() matches the one we did on the diagram, you have understood the essence of this lesson.
Common Mistakes and Tips
- Mistake: thinking artificial neurons "work like the brain". The biological inspiration is distant; an artificial neuron is just a formula that multiplies, adds and transforms. Avoid reasoning about neural networks with brain metaphors: they lead to wrong conclusions.
- Mistake: confusing parameters with hyperparameters. Parameters (weights, biases) are learned by the network; hyperparameters (layers, batch, epochs) are chosen by you. In technical conversations the distinction is always maintained.
- Mistake: evaluating the model on the training data. It is the most serious beginner error: it yields inflated metrics that collapse in production. The number that counts is the test number.
- Mistake: using the test dataset many times during development. That is what the validation set is for. The test set is touched once, at the end.
- Tip: when you come across a new term in the course, translate it into the questions "is this decided by the human or learned by the network?" and "is this a piece of the network or a piece of the training?". Those two questions sort out almost all of deep learning's vocabulary.
Exercises
Exercise 1: Anatomy of a neuron
A neuron in TecnoMarket's anti-fraud system receives three inputs about a transaction: amount (normalized), 1 if the shipment goes to a new address and 0 if not, and number of purchases in the last hour. Its weights are w = (0.8, 0.9, 0.7) and its bias b = −1.5.
- What does the positive sign of the three weights indicate?
- What role does the negative bias of −1.5 play?
- Without calculating anything: which transaction will activate this neuron more, (0.9, 1, 3) or (0.1, 0, 0)? What does this neuron interpret, in words?
Exercise 2: Count the parameters
You design a network for TecnoMarket that predicts a product's demand from 5 input variables, with one hidden layer of 8 neurons, another of 4, and one output neuron (the forecast number of units). How many weights, how many biases and how many total parameters does the network have?
Exercise 3: Vocabulary in action
TecnoMarket trains its classifier with 40,000 training photos, batches of 50 and 20 epochs, setting aside 5,000 photos for validation and 5,000 for test.
- How many weight adjustments are performed per epoch? And in total?
- When it finishes, accuracy is 99% on training, 91% on validation and 90% on test. Which figure would you give management as the expected performance in production? What does the gap between 99% and 91% suggest?
Solutions
Solution 1:
- The three positive weights indicate that the three inputs push in the same direction: the larger they are (high amount, new address, many purchases in a row), the larger the neuron's output.
- The negative bias acts as a demand threshold: it subtracts 1.5 from the sum, so considerable evidence (high, well-weighted inputs) is needed for the neuron to activate strongly. It is the neuron's "caution".
- The transaction (0.9, 1, 3): all its inputs are larger and the weights are positive. In words, this neuron fires on "expensive, rapid-fire purchases going to new addresses": a pattern suspicious of fraud. (In a real network, this pattern would have been discovered by training, not by a human.)
Solution 2:
- Weights: 5×8 + 8×4 + 4×1 = 40 + 32 + 4 = 76 weights.
- Biases: 8 + 4 + 1 = 13 biases (one per computing neuron; the input layer has none).
- Total: 76 + 13 = 89 parameters.
Solution 3:
- Per epoch: 40,000 / 50 = 800 adjustments (one per batch). In total: 800 × 20 = 16,000 adjustments.
- The figure for management is the 90% from the test set: it is the only measurement on completely untouched data. The gap between the 99% on training and the 91% on validation suggests overfitting: the network has partly memorized the training examples and performs worse on new data. Regularization techniques or training adjustments would be needed (we will see this in lesson 05-04).
Conclusion
You now know the building blocks: the artificial neuron (inputs × weights + bias → activation), the layers (input, hidden, output) that connect to form the network, and the central idea that training means adjusting millions of weights in a loop by measuring and correcting the error. You also handle the indispensable vocabulary — parameters, batch, epoch, hyperparameters — and the discipline of the three datasets (training, validation, test) that separates professionals from amateurs.
With the basic theory in your backpack, only one thing is missing before you can start building: a place to run code. In the next lesson we will set up the work environment — Google Colab or a local installation, Jupyter, and the TecnoMarket project folder structure — and verify that everything works, GPU included.
Deep Learning Course
Module 1: Introduction to Deep Learning
- What is Deep Learning?
- History and evolution of Deep Learning
- Applications of Deep Learning
- Basic concepts of neural networks
- Setting up the work environment
Module 2: Neural Network Fundamentals
- Perceptron and Multilayer Perceptron
- Activation functions
- Forward and backward propagation
- Optimization and loss functions
- Your first complete neural network
Module 3: Convolutional Neural Networks (CNN)
- Introduction to CNNs
- Convolutional and pooling layers
- Popular CNN architectures
- CNN applications in image recognition
Module 4: Recurrent Neural Networks (RNN)
- Introduction to RNNs
- LSTM and GRU
- RNN applications in natural language processing
- Sequences and time series
Module 5: Advanced Deep Learning Techniques
- Generative Adversarial Networks (GAN)
- Autoencoders
- Transfer Learning
- Regularization and improvement techniques
- Attention mechanisms and Transformers
Module 6: Tools and Frameworks
- Introduction to TensorFlow
- Introduction to PyTorch
- Framework comparison
- Development environments and additional resources
- Saving, loading and deploying models
Module 7: Hands-On Projects
- Image classification with CNNs
- Text generation with RNNs
- Anomaly detection with Autoencoders
- Building a GAN for image generation
- Fine-tuning a pretrained model
