Artificial intelligence · lesson 1 of 4
Neural layers, activations and parameter counts
A dense layer computes z=Wx+b followed by an activation. Dimensions must agree; each output has its own weighted combination.
Learn the ideas
Prerequisites: Vectors, matrix multiplication and functions.
Layer
A dense layer computes z=Wx+b followed by an activation. Dimensions must agree; each output has its own weighted combination.
Nonlinearity
Nonlinear activations allow compositions that are not just one affine map. Stacking affine layers alone collapses to another affine map.
Parameters
For d inputs and h outputs, a dense layer with one bias per output has dh+h parameters.
ReLU
ReLU(z)=max(0,z). It is piecewise linear and nondifferentiable at zero; implementations choose a convention there.
Worked examples
A dense layer has 3 inputs and 4 outputs with one bias per output. Count parameters.
3×4+4=16.
16
Find ReLU(−2).
max(0,−2)=0.
0
Check your understanding
8 questionsDecimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.