What Activation Functions Do

A linear layer produces a raw value:

z = x . w + b

An activation function transforms that value:

a = g(z)

The activation output a becomes the value passed to the next part of the model.

Without activation functions, a stack of linear layers collapses into another linear map. With activation functions, the model can build nonlinear patterns from simple pieces.

One scalar example

Suppose:

z = -3

A ReLU activation gives:

relu(z) = max(0, z)
        = max(0, -3)
        = 0

The activation changed the value. That change is what lets later layers receive a transformed signal rather than just another linear score.

DL-C04-T01-001Exercise: Apply an activation

Let z = -4 and g(z) = max(0, z). What is g(z)?

Compute it first, then check your number.

HintUse max

Compare 0 and -4.

SolutionWork it out

g(-4) = max(0, -4) = 0.

DL-C04-T01-002Exercise: Linear value before activation

A layer computes z = x . w + b. Enter 1 if z is the pre-activation value, or 0 if it is the value after activation.

Compute it first, then check your number.

HintLook at the order

The activation is applied after z is computed.

SolutionWork it out

z is computed by the linear part. The activation output is usually written as a = g(z).