Compose affine maps with nonlinear hidden activation functions, for example . Several hidden units can respond to different linear combinations of input features; later units combine their responses to represent curved or piecewise-linear decision boundaries and interactions. A product interaction can be understood from : units approximating nonlinear functions of and can represent effects that no single additive linear fit captures.
Nonlinearity in hidden layers is essential: with only identity activations, repeated affine maps collapse to one affine map regardless of depth. Width and depth determine available representations; regularization, validation and suitable optimization are needed to learn useful rather than overfitted interactions. A nonlinear output activation alone applied to one linear score does not give an unrestricted model of feature interactions.