How it works

Activation is the transformation applied to the output of an artificial neuron or of a layer in a neural network. In many models, inputs are first combined with weights, and then an activation function transforms that value before it is passed on.

The function you choose defines how the network responds to the values it receives. Some functions introduce non-linearity, that is, they allow multiple layers to represent more complex relationships than a simple linear combination. Without this kind of transformation between layers, stacking linear operations would not give the network the same ability to model non-linear patterns.

ReLU, sigmoid and softmax are well-known examples of activation functions, but each has distinct properties and uses. ReLU keeps positive values and zeroes out negatives. Sigmoid maps a value to a range between zero and one, which can be useful when you need to interpret an output as a probability-like score, provided the application does the proper calibration. Softmax transforms a set of values into a normalized distribution, often used in classification with mutually exclusive classes.

Activation is not, by itself, the final decision of the system. It is a mathematical step in the model's computation. The meaning of the output depends on the architecture, the training, the data, and how the application interprets the result.

Practical example

Imagine a network that receives features from an image and needs to choose a category. One layer computes combinations of the input values. The activation function transforms those combinations and allows the next layer to receive more useful signals for distinguishing patterns.

In the final layer, the model can produce a value for each category. An application that uses softmax can convert those values into a distribution that sums to one. If the highest value category is "cat", that indicates the model's preference among the configured classes, but it does not prove that the image was classified correctly.

In an educational notebook, you can replace ReLU with another function and observe how training and predictions change. For a valid comparison, keep the data, architecture, and training process constant. Otherwise, differences may come from several changes at once.

In practice, machine learning libraries implement these functions and compute their gradients for training. Developers usually choose an appropriate architecture or use a ready-made model, instead of programming each mathematical operation from scratch.

What it's for

Activation allows neural networks to learn complex relationships between data. The choice can affect training ease, gradient behavior, and output interpretation.

In classification, an activation in the final layer can help represent scores per class. In internal layers, the function is usually chosen to allow efficient learning within the architecture. These choices do not guarantee good generalization; you need to evaluate the model on data that was not used in training.

When studying a network, observe where activation is applied and what each output represents. An apparent probability should not be taken as certainty, and a function does not fix inadequate data, wrong labels, or weak experimental design.

In summary, activation transforms signals inside the network and influences what it can learn. It is one piece of the model, which needs to be interpreted together with the data, training, and final task.