Contribute
Adding new targets
A target should be structured as a (sub-)Python package as follows:
target_package_name/
├── __init__.py
│ contains:
│ from .impl_module import TargetClassName
│ __all__ = ["TargetClassName"]
└── impl_module.py
contains the class implementation TargetClassName
Templates to create targets can be found under:
https://github.com/ChristophervonKlitzing/boltzkit/tree/main/templates/targets
A target is a composition of capability providers that define how it behaves,
for example whether it can evaluate densities or provide datasets. The minimal requirement
is to inherit from BaseTarget.
Density providers
Define how a target evaluates probabilities and scores.
NumpyDensityProviderNumPy-based implementation of log_prob and score functions.DispatchedDensityProviderMulti-backend implementation supporting NumPy, PyTorch, and JAX.
Dataset providers
Define how a target provides or constructs datasets.
ExternalDatasetProviderUses a manually specified dataloader such asCachedRepoDatasetLoaderto load datasets from external sources like Hugging Face.ProceduralDatasetProviderGenerates datasets procedurally (e.g. Gaussian mixture models).