Installation
TabEBM
View source TabEBM: Tabular Energy-Based Model for synthetic data generation.
This class implements an energy-based model that uses TabPFN as the underlying
classifier to define energy functions. It generates synthetic tabular data
using Stochastic Gradient Langevin Dynamics (SGLD) sampling.
The core idea is to treat each class as having its own energy landscape,
where real data points have low energy and synthetic points are generated
by following the energy gradient through SGLD sampling.
Initialize TabEBM with optimized configuration.
TabEBM.add_surrogate_negative_samples
View source TabEBM’s binary classification approach.
This method creates artificial “negative” samples at specified distances from the origin
to enable energy-based modeling through binary classification. The surrogate negatives
help define the energy landscape by providing clear decision boundaries.
For 2D data, negatives are placed at the four corners of a square centered at origin.
For higher dimensions, random combinations of ±distance_negative_class are used.
TabEBM.compute_energy
View source TabEBM class-specific energy function.
The energy function is defined as:
E_c(x) = -log(exp(f^c(x)[0]) + exp(f^c(x)[1]))
Where f^c(x) are the logits from the class-specific binary classifier.
Lower energy corresponds to higher probability of belonging to the target class.
ValueError
If logits are not unnormalized or have wrong type
TabEBM.generate
View source TabEBM.train_test_split_allow_full_train
View source test_size=0, which means we want to use all data for training (no validation).
This is useful for TabEBM’s energy-based training approach.
seed_everything
View source to_numpy
View source ValueError
If input type is not supported