liveBook · Manning

Nonlinear mapping

As explained in Inside Deep Learning: Math, Algorithms, Models

A transformation inserted between linear steps to let a neural network represent functions that are not purely linear.

A nonlinearity follows a linear operation so a neural network can build complex functions instead of remaining purely linear. These functions are called activation functions. section 2.2.3

Two historical activation functions illustrate the idea:

Insert tanh between linear layers

In PyTorch, use nn.Sequential(nn.Linear(1, 10), nn.Tanh(), nn.Linear(10, 1)). With two linear layers, one activation sits between the hidden and output layers. section 2.2.3

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Defines sigmoid and tanh, gives their ranges, and demonstrates tanh placement in a PyTorch network.
Examples
Uses sigmoid and tanh plots plus a two-layer nn.Sequential model with nn.Tanh.
What you can do after
Build it from scratch by placing nn.Tanh between PyTorch linear layers.
How it connects
Connects activation functions with linear layers, neural networks, sigmoid, and hyperbolic tangent.

Also explained in

Compare how 7 books explain nonlinear mapping →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.