Activation function
An activation function transforms a neural-network unit’s or layer’s input into an output, often introducing nonlinearity.
Grokking Machine Learning
A function that transforms a model's score into an output or prediction.
- How it is used
- Transforms a model’s weighted score into a prediction, probability-like score, or intermediate neural-network value.
- How deep it goes
- Defines threshold and continuous functions, compares their outputs, and connects them to neural-network nonlinearity and gradient problems.
- Examples
- Uses alien mood classification, word-count features, perceptron scores, sigmoid happiness ratings, and neural-network layers.
- What you can do after
- Apply a named activation function to turn weighted model scores into binary predictions, continuous scores, or nonlinear neural-network outputs.
Read how Grokking Machine Learning explains activation function →
Grokking AI Algorithms, Second Edition
An activation function is a nonlinear or linear mathematical function that transforms a neuron's weighted input before passing the result onward.
- How it is used
- Uses activation functions to transform weighted sums in perceptrons, multilayer neural networks, and Transformer feed-forward layers.
- How deep it goes
- Explains common function shapes, learning trade-offs, forward-pass calculations, and the role of activation slopes in backpropagation.
- Examples
- Illustrates sigmoid forward propagation with car-collision predictions and traces ReLU through a Transformer projection.
- What you can do after
- Builds a sigmoid-based forward pass from scratch using NumPy.
Read how Grokking AI Algorithms, Second Edition explains activation function →
Natural Language Processing in Action, Second Edition
An activation function is a nonlinear function applied to a neural-network signal to transform its value before further processing.
- How it is used
- Transforms neuron signals and CNN match scores into outputs suited to prediction tasks.
- How deep it goes
- Explains threshold and logistic activations through a weighted-sum example and distinguishes output activations; the neuron implementation covers only the feed-forward path.
- Examples
- Uses a four-word count vector and random weights to demonstrate a thresholded neuron.
- What you can do after
- Evaluate activation choices for binary decisions, continuous likelihoods, mutually exclusive categories, and multi-label outputs.
Read how Natural Language Processing in Action, Second Edition explains activation function →
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
An activation function is a function applied to a neuron's output to introduce nonlinearity and constrain the output range in a neural network.
- How it is used
- Transforms each neuron's weighted input before its signal passes through a feed-forward network.
- How deep it goes
- Implements sigmoid and its derivative, then uses both in forward passes and backpropagation without deriving the calculus formulas.
- Examples
- Uses Swift sigmoid functions, neuron and layer implementations, and an exercise comparing alternative functions.
- What you can do after
- Build it from scratch in Swift and test how a replacement activation function changes network accuracy and training.
Inside Deep Learning: Math, Algorithms, Models
A nonlinear function applied in a neural network to transform layer outputs and increase representational power.
- How it is used
- Adds nonlinear capacity between neural-network layers so models can learn more complex functions.
- How deep it goes
- Defines sigmoid, tanh, ReLU, and Leaky ReLU with ranges, derivatives, plots, and PyTorch placement, while deferring broader properties.
- Examples
- Uses activation plots, a tanh regression network, deep fully connected and convolutional models, and LeakyReLU and PReLU exercises.
- What you can do after
- Build it from scratch by inserting PyTorch activations, plotting their curves, and comparing ReLU variants in trained models.
Read how Inside Deep Learning: Math, Algorithms, Models explains activation function →
Deep Learning with PyTorch, Second Edition
A nonlinear function applied within a neural network to transform signals so the whole model can represent more complex mappings than a purely linear model.
- How it is used
- Introduces nonlinearity between linear operations and constrains outputs when a task calls for a particular range.
- How deep it goes
- Explains neuron-level composition, common activation shapes, differentiability, and saturation, with an intuitive account of function approximation.
- Examples
- Uses a dog-likeness scoring example and a sequential network with tanh between two linear layers.
- What you can do after
- Apply activation functions via PyTorch nn modules and consider output range and saturation when choosing one.
Read how Deep Learning with PyTorch, Second Edition explains activation function →
Data Without Labels
An activation function is a mathematical function applied to a neuron's combined input to determine its output, typically introducing nonlinearity.
- How it is used
- Determines neuron outputs as weighted information moves through network layers toward a prediction.
- How deep it goes
- Defines the function, explains the case for nonlinearity, and distinguishes common choices without implementing them in Python.
- Examples
- Illustrates the concept with a threshold perceptron, activation-function curves, and face-identification predictions.
- What you can do after
- Evaluate/understand it by relating sigmoid to binary output and TANH or ReLU to hidden-layer processing.
Optimization Algorithms: AI techniques for design, planning, and control problems
An activation function is a function applied to a neural-network unit’s pre-activation value to produce its output and introduce nonlinear behavior.
- How it is used
- Uses nonlinear unit outputs within neural-network forward passes and training optimization.
- How deep it goes
- Defines the role, lists major forms, and demonstrates tanh in code without deriving activation-function formulas.
- Examples
- Demonstrates tanh applied to hidden-layer values in a penguin-classification neural network.
- What you can do after
- Apply it via NumPy by inserting an activation into a neural-network forward pass.
Deep Learning with R, Third Edition
An activation function transforms a neural-network unit's pre-activation value into its output, often element by element.
- How it is used
- Deploys activations inside Dense layers to create nonlinear representations and probability-producing outputs for classification.
- How deep it goes
- Explains affine composition, relu and sigmoid behavior, and nonlinear necessity, while only naming alternatives such as prelu and elu.
- Examples
- Uses a three-layer Keras classifier, relu and sigmoid output expressions, and geometric figures contrasting affine and activated transformations.
- What you can do after
- Apply it via Keras by placing relu in intermediate layers and sigmoid in a binary-classification output layer.
Read how Deep Learning with R, Third Edition explains activation function →
Sutskever's List
An activation function transforms a neuron's weighted input before passing its output to subsequent layers.
- How it is used
- Shows how ReLU helped AlexNet train deeper networks by preserving gradient flow.
- How deep it goes
- Explains ReLU's input mapping, contrasts it with sigmoid and tanh, and connects gradient flow to convergence without formal derivation.
- Examples
- Compares ReLU, sigmoid, and tanh curves and reports a sixfold convergence gain over tanh in AlexNet.
- What you can do after
- Evaluate how ReLU's input mapping and gradient behavior differ from sigmoid and tanh.
Deep Learning with JAX
A nonlinear function applied inside a neural network to let stacked layers represent more than a single linear transformation.
- How it is used
- Enables multilayer neural networks to express nonlinear relationships during the forward pass.
- How deep it goes
- Defines layer computation, explains linear collapse, and demonstrates Swish in JAX without deriving activation formulas.
- Examples
- Demonstrates Swish inside a JAX prediction function for a ten-class neural network.
- What you can do after
- Apply activation functions through jax.nn.swish in a stateless JAX forward pass.
Read how Deep Learning with JAX explains activation function →
Graph Neural Networks in Action
An activation function is a nonlinear or otherwise specified function applied to a layer's transformed values.
- How it is used
- Uses nonlinear transformations inside graph message-passing layers to produce expressive node or graph representations.
- How deep it goes
- Defines the transformation and positions it within aggregation, transformation, and update steps, including a message-passing formula.
- Examples
- Uses ReLU, defined as the maximum of zero and the input, after aggregated messages are transformed.
- What you can do after
- Evaluate why nonlinear activation is required for expressive multilayer graph neural networks.
Read how Graph Neural Networks in Action explains activation function →
Machine Learning Algorithms in Depth
An activation function is a nonlinear function applied to a neural-network layer output to increase the model's expressive capacity.
- How it is used
- Introduces nonlinearity between multilayer perceptron layers to increase expressive power for classification and regression.
- How deep it goes
- Defines ReLU and identifies softmax and identity by output task, but defers detailed activation derivatives and comparisons.
- Examples
- Uses ReLU in hidden layers, softmax for classification, identity for regression, and an MLP architecture as concrete examples.
- What you can do after
- Evaluate activation choices for hidden layers and classification or regression output layers.
Read how Machine Learning Algorithms in Depth explains activation function →
Deep Learning with Python, Third Edition
A nonlinear function applied to a layer’s output to reshape it and increase model expressiveness.
- How it is used
- Shapes intermediate representations and constrains final predictions for classification or regression.
- How deep it goes
- Explains relu through tensor operations and output behavior, but defers formal principles for choosing layer architectures.
- Examples
- Uses a sentiment classifier with relu and sigmoid, plus scalar regression with a linear final layer.
- What you can do after
- Apply it via Keras by matching hidden-layer and output activations to the prediction task.
Read how Deep Learning with Python, Third Edition explains activation function →
Related concepts
- sigmoidincludes · The logistic sigmoid is a smooth, S-shaped function that maps real-valued inputs to values between zero and one.
- ReLUincludes · ReLU is an activation function that maps each input to the greater of that input and zero.
- step functionincludes · A step function is a piecewise-constant function that changes abruptly between discrete output values when its input crosses one or more specified thresholds.
- nonlinear mappingproduces · A function or transformation that does not preserve linear combinations of its inputs.
- GELUincludes · GELU, or Gaussian error linear unit, is a smooth activation function that scales an input by the standard normal cumulative distribution function evaluated at that input.
- Swishincludes · Swish, also called SiLU, is a smooth neural-network activation function defined as x multiplied by the sigmoid of βx.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.













