liveBook · Manning

Reparameterization trick

The reparameterization trick expresses a random variable as a deterministic function of parameter-independent noise and distribution parameters, enabling gradients to pass through stochastic sampling.

How 4 Manning books explain it

Build AI Drug Discovery Pipelines

The reparameterization trick expresses stochastic sampling from a parameterized distribution as a differentiable transformation of distribution parameters and independent noise.

How it is used
Enables training a molecular variational autoencoder despite random latent sampling.
How deep it goes
Connects Gaussian distribution parameters and standard-normal noise to latent sampling, while deferring longer probabilistic derivations.
Examples
Uses a SMILES molecular encoding pipeline and an end-to-end forward pass that samples a latent vector before decoding.
What you can do after
Apply it via PyTorch in a molecular VAE that encodes distribution parameters and decodes a sampled latent vector.

Read how Build AI Drug Discovery Pipelines explains reparameterization trick →

Applied Reinforcement Learning

A stochastic-gradient technique that expresses a random sample as a deterministic transformation of parameter-independent noise.

How it is used
Enables gradients to flow through stochastic action sampling when training a policy by backpropagation.
How deep it goes
Explains the noise transformation and its gradient benefit, then shows its use in Gaussian action sampling.
Examples
Illustrates sampling fan and valve controls for data-center cooling, then squashing actions into the 0–1 range.
What you can do after
Apply Normal.rsample() to generate differentiable stochastic actions for policy learning.

Read how Applied Reinforcement Learning explains reparameterization trick →

Causal AI

A reparameterization trick rewrites a stochastic variable as a deterministic function of newly introduced exogenous random variables while preserving its marginal distribution.

How it is used
Converts causal generative models into structural causal models with explicit exogenous noise and deterministic assignments.
How deep it goes
Explains normal and discrete constructions, then cautions that distributional preservation does not identify a unique causal model.
Examples
Uses a femur–height model, a weighted-coin flip, uniform stick breaking, and a three-sided die.
What you can do after
Evaluate alternative SCM constructions by checking distributional preservation and the causal assumptions induced by their mappings.

Read how Causal AI explains reparameterization trick →

Grokking Bayes

The reparameterization trick expresses a random variable as a differentiable transformation of fixed noise and distribution parameters so gradients can be computed through stochastic sampling.

How it is used
Enables automatic differentiation and gradient descent when optimizing the ELBO with variational inference.
How deep it goes
Defines the transformation and explains its gradient path for Normal distributions, while deferring cases without a fixed-noise rewrite.
Examples
Uses a Normal transformation and a water-pipe analogy to illustrate fixed noise, differentiable operations, and restored gradient flow.
What you can do after
Apply the trick to rewrite Normal samples so gradient-based variational inference can optimize distribution parameters.

Read how Grokking Bayes explains reparameterization trick →

Also covered in

What to know first

Related concepts

Questions about reparameterization trick

What is reparameterization trick?

The reparameterization trick expresses a random variable as a deterministic function of parameter-independent noise and distribution parameters, enabling gradients to pass through stochastic sampling.

Which Manning books explain reparameterization trick?

Build AI Drug Discovery Pipelines, Applied Reinforcement Learning, Causal AI and Grokking Bayes.

What should I know before learning reparameterization trick?

Manning books that teach reparameterization trick usually introduce normal distribution, mean, variance and backpropagation first.

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.