TorchEBM provides components for 🔬 sampling, 🧠 inference, and 📊 model training.
What is 🍓 TorchEBM?¶
TorchEBM is a PyTorch library for Energy-Based Models (EBMs), a powerful class of generative models. It provides a flexible framework to define, train, and generate samples using energy-based models.
Core Components¶
TorchEBM is structured around several key components:
-
Models
Define energy functions using
BaseModel, from analytical forms to custom neural networks. -
Samplers
Generate samples with MCMC samplers like Langevin Dynamics and Hamiltonian Monte Carlo.
-
Loss Functions
Train models with loss functions like Contrastive Divergence and Score Matching.
-
Datasets
Use synthetic dataset generators for testing and visualization.
-
Visualization
Visualize energy landscapes, sampling, and training dynamics.
-
Accelerated Computing
Accelerate sampling and training with CUDA implementations.
Quick Start¶
Install the library using pip:
Here's a minimal example of defining an energy function and a sampler:
-
Create and Sample from Energy Models
Latest Release
TorchEBM is currently in early development. Check our GitHub repository for the latest updates and features.
Community & Contribution¶
TorchEBM is an open-source project developed with the research community in mind.
- Bug Reports & Feature Requests: Please use the GitHub Issues.
- Contributing Code: We welcome contributions! Please see the Contributing Guidelines. Consider following the Commit Conventions.
- Show Support: If you find TorchEBM helpful for your work, please consider starring the repository on GitHub!
Citation¶
Please consider citing the TorchEBM repository if it contributes to your research:
License¶
TorchEBM is available under the MIT License. See the LICENSE file for details.