The Sampling Gallery
The Sampling Gallery is an interactive, browser-based collection of Monte Carlo, MCMC, and related sampling algorithms. On paper, each algorithm is only a few lines of mathematics, but its behaviour is not always obvious. These visualisations let you watch a sampler explore a landscape in real time — where it proposes, what it rejects, and how gradients, trajectories, and adaptation shape the search. Pick a target distribution — a banana, a ring, a mixture of hills — choose an algorithm, tune its parameters, and watch it run.
The tool is designed for teaching and for building intuition about how different samplers behave — where they mix well, where they struggle, and how their tuning parameters affect performance. It builds on the excellent mcmc-demo by Chi Feng.
Samplers
The gallery currently includes the following algorithms:
Independent Monte Carlo
- Rejection Sampling
- Importance Sampling (with optional SIR resampling and Pareto-smoothed importance sampling)
- Quasi-Monte Carlo
Markov chain Monte Carlo
- Random Walk Metropolis
- Adaptive Metropolis
- Hamiltonian Monte Carlo
- No-U-Turn Sampler (NUTS)
- Riemannian-Manifold HMC
- Apogee-to-Apogee Path Sampler
- Metropolis-adjusted Langevin (MALA)
- Slice Sampling
- Elliptical Slice Sampling
- Gibbs Sampling
- Hessian-Hamiltonian Monte Carlo (H2MC)
- Unadjusted Langevin (ULA)
- Stochastic Gradient Langevin Dynamics (SGLD), with optional control variates
- Tuning-free ULA (FUSE)
Ensemble and multimodal methods
- Ensemble MCMC (affine-invariant stretch moves, with a differential evolution mode)
- Parallel Tempering
Sequential and annealed methods
- Tempered Sequential Monte Carlo (SMC), with an annealed importance sampling mode
- Nested Sampling
Non-reversible samplers
- Zig-Zag Sampler
- Bouncy Particle Sampler
Deterministic and variational particle methods
- Stein Variational Gradient Descent
- Coin SVGD
- Wasserstein Particle Descent
- Stochastic Particle-Optimization Sampling
Ask a question or open an issue
The source code is available on GitHub . Suggestions for new samplers or target distributions are welcome — please open an issue on the repository.