Change and uncertainty / 7 of 7
Mathematical foundations of neural networks
What you’ll learn
- Explain the main idea of “Mathematical foundations of neural networks” 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
A dense neural layer combines an affine transformation (a weighted sum plus a bias) with an activation. Stacking affine layers without nonlinear activations still produces a single affine transformation. Nonlinearity gives a network the ability to model more complex relationships.
Use small numbers first and work one operation at a time. Track the shape and units of every quantity before doing algebra. The equations here describe idealized objects; implementing them on a computer introduces finite precision and resource constraints. You can understand the mechanism before learning every proof.
Under the hood
A dense layer computes h=σ(Wx+b). Parameters include every weight and bias. With n inputs and m outputs, a dense layer has nm+m parameters, independent of batch size.
Activation values depend on inputs; parameters are learned across examples.
A worked example
A layer with 4 inputs and 3 outputs has 12 weights and 3 biases: 15 trainable parameters.
How to use this way of thinking
Check a symbolic result with a numeric example, then consider an edge case such as zero, a very large value, or an incompatible shape. Explain what each symbol means rather than memorizing the equation. If a result surprises you, inspect the assumptions and the units first.
See the mechanism
Set the network to 5 hidden units and both inputs to 0. Which units still have a nonzero activation? Check the bias column in the weights table.
Opening the experiment…
Try it yourself
Explain why two dense layers with biases and no activation can be merged.
Key takeaways
- 15
- Activation values depend on inputs; parameters are learned across examples.
- 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.
Mathematics for Machine Learning (open textbook) (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.