Skip to main content

Installation

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.
Parameters

TabEBM.add_surrogate_negative_samples

View source
Create surrogate negative samples for 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.
Parameters
Returns

TabEBM.compute_energy

View source
Compute 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.
Parameters
Returns
Raises ValueError If logits are not unnormalized or have wrong type

TabEBM.generate

View source
Generate synthetic samples using Stochastic Gradient Langevin Dynamics (SGLD). This method creates synthetic data by treating the TabPFN classifier as an energy function and using SGLD to sample from the learned energy landscape. For each class, it creates a binary classification problem (target class vs surrogate negatives) and samples new points by following energy gradients.
Parameters
Returns

TabEBM.train_test_split_allow_full_train

View source
Enhanced train-test split that supports full training mode. This method extends sklearn’s train_test_split to handle the case where 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.
Parameters
Returns

seed_everything

View source
Set random seeds for reproducibility across all libraries.
Parameters
Returns

Convert input data to numpy array format.
Parameters
Returns
Raises ValueError If input type is not supported