Inside a neural network / 2 of 7
Activation functions
What you’ll learn
- Explain the main idea of “Activation functions” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Activation functions introduce nonlinearity so a network can model more than affine transformations. Their output ranges and gradients influence how information and learning signals flow through the network.
Treat a neural network as a computation graph, not a mysterious black box. Follow a tiny input through each operation and keep track of tensor shapes. Distinguish the forward pass, gradient computation, and optimizer update. These three stages are connected but solve different parts of the learning problem.
Under the hood
ReLU outputs max(0,x). Sigmoid maps to (0,1) but saturates at large magnitudes. Softmax normalizes a vector of logits into class probabilities, with outputs summing to one.
A softmax probability is not automatically calibrated confidence.
A worked example
ReLU applied to [−2,0,3] yields [0,0,3]. It is inexpensive but units with persistently negative inputs can stop receiving useful gradients.
How to use this way of thinking
Build intuition with a small calculation before scaling dimensions. Check whether the architecture can represent the desired relationship, then whether optimization can learn it, then whether the learned solution generalizes. A failure in any one of these stages needs a different response.
Try it yourself
Compare sigmoid outputs at 0 and at a very large positive input.
Key takeaways
- To represent nonlinear relationships
- A softmax probability is not automatically calibrated confidence.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Dive into Deep Learning (opens a new tab)PyTorch: automatic differentiation (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.