Flow-Matching BDT
A small library for training flow-matching models. Its primary focus is using efficient algorithms for tabular learning — e.g. histogram boosted-decision trees — but it works with any scikit-learn compatible regressor.
Installation
pip install flowmatching-bdt
Quick Start
from sklearn.datasets import make_moons
from flowmatching_bdt import FlowMatchingBDT
data, _ = make_moons(n_samples=500, noise=0.1, random_state=0)
model = FlowMatchingBDT()
# train the model
model.fit(data)
# generate new samples
samples = model.predict(num_samples=500)
Conditional Generation
import numpy as np
from sklearn.datasets import make_moons
from flowmatching_bdt import FlowMatchingBDT
data, labels = make_moons(n_samples=500, noise=0.1, random_state=42)
model = FlowMatchingBDT()
model.fit(data, conditions=labels)
conditions = np.ones(500)
samples = model.predict(num_samples=500, conditions=conditions)
How It Works
Flow matching trains a model to predict a velocity field that transports samples from a simple source distribution (e.g. Gaussian noise) to the data distribution. This implementation:
- Discretises the flow into
n_flow_stepstime steps - Trains one regressor per step to predict the velocity field
- At inference, integrates the learned field using Euler steps to generate new samples
Gradient-boosted trees can learn this velocity field just as well as neural networks, while being faster to train on tabular data.
Useful Resources
- Introduction to Flow Matching — Tor Fjelde, Emilie Mathieu, Vincent Dutordoir
- Generating Tabular Data with XGBoost — Alexia Jolicoeur
Citation
This repository started as a reproduction of the following paper:
@inproceedings{jolicoeur2024generating,
title={Generating and Imputing Tabular Data via Diffusion and Flow-based Gradient-Boosted Trees},
author={Jolicoeur-Martineau, Alexia and Fatras, Kilian and Kachman, Tal},
booktitle={International Conference on Artificial Intelligence and Statistics},
pages={1288--1296},
year={2024},
organization={PMLR}
}
Acknowledgements
This repository is inspired heavily and borrows parts from lucidrains (project structure) and torch-cfm.
Metadata
Release files for flowmatching-bdt 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flowmatching_bdt-0.3.0.tar.gz | 19.2 MB | Without provenance | Details for flowmatching_bdt-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flowmatching_bdt-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for flowmatching_bdt-0.3.0-py3-none-any.whl |
Total release size: 19.2 MB
Release files / flowmatching_bdt-0.3.0.tar.gz
| Download URL | flowmatching_bdt-0.3.0.tar.gz |
|---|---|
| Size | 19.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
422f0540c4c94eb2cbca281aee0c801e885c26496c592819b622d12c2d14a6e7
|
|
BLAKE2b-256 checksum How to use checksums |
0ce3df23eea342d5c7c3a1c5125961544c5bb552dc92cbe68f1f2b1fe3e1ed83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / flowmatching_bdt-0.3.0-py3-none-any.whl
| Download URL | flowmatching_bdt-0.3.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed66ae95468ae958b4a690c2209ae149d61213e4dac9d3c8cf0a56d8dfd8e090
|
|
BLAKE2b-256 checksum How to use checksums |
8259f9003d5a07a32d69cb649ce1e6cfd83332f3a5b6d1ed0f85bad9a3677218
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for flowmatching-bdt 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.