Skip to content

TorchEBM API Reference

Welcome to the TorchEBM API reference documentation. This section provides detailed information about the classes and functions available in TorchEBM.

Package Structure

TorchEBM is organized into several modules:

Getting Started with the API

If you're new to TorchEBM, we recommend starting with the following classes:

Core Components

Models

TorchEBM provides various built-in models:

Model Description
GaussianModel Multivariate Gaussian energy function
DoubleWellModel Double well potential energy function
RastriginModel Rastrigin function for testing optimization algorithms
RosenbrockModel Rosenbrock function (banana function)
AckleyModel Ackley function, a multimodal test function
HarmonicModel Harmonic oscillator energy function

Samplers

Available sampling algorithms:

Sampler Description
LangevinDynamics Langevin dynamics sampling algorithm
HamiltonianMonteCarlo Hamiltonian Monte Carlo sampling

BaseLoss Functions

TorchEBM implements several loss functions for training EBMs:

BaseLoss Function Description
ContrastiveDivergence Standard contrastive divergence (CD-k)
PersistentContrastiveDivergence Persistent contrastive divergence
ParallelTemperingCD Parallel tempering contrastive divergence

Module Details

For detailed information about each module, follow the links below: