PyTorch-BSF
Fit smooth manifolds with explicit geometry, observations and numerical evidence.
PyTorch-BSF fits Bézier simplices, products of simplices, and cells glued along shared faces. A single model type and regression API cover all three.
import torch
from torch_bsf import BezierSpace, Samples, fit
space = BezierSpace.simplex(dimension=1, degree=2)
t = torch.tensor([[1.0, 0.0], [0.5, 0.5], [0.0, 1.0]])
result = fit(space, Samples(t, [[0.0], [1.0], [4.0]]))
result.require_success()
predictions = result.model(t)
print(result.metrics, result.diagnostics)
BezierSpaceholds immutable geometry and shared coefficient ordering.BezierModelis a differentiable PyTorch module containing coefficients.fit(space, samples)always returnsFitResult: model, metrics, diagnostics and stopping state.- Dense SVD and optional sparse LSMR solve the same weighted, penalized objective in CPU float64.
- Objective minimization uses
minimizewith explicitPreconditionedSGDsettings. - Cross-validation, degree search and ensembles retain explicit evidence and ownership.
- Sampling, plotting, subdivision and versioned persistence use the same model types.
Install with Python 3.10 or later:
pip install pytorch-bsf
# Optional: sparse solving, plotting, scikit-learn, execution or recording
pip install 'pytorch-bsf[sparse,plot,sklearn,lightning,mlflow]'
Conda is an optional environment manager. Lightning and MLflow are optional adapters and are never imported by core fitting. Random/Sobol sampling needs no extra dependency. Tracking is opt-in.
python -m torch_bsf fit --params params.csv --values values.csv --degree 3 --save model.bsf
python -m torch_bsf predict --model model.bsf --params params.csv --save predictions.csv
bash examples/quickstart/run.sh
Save and load any model, including glued geometry, with
torch_bsf.io.save_model / load_model. The format is versioned and does not
pickle Python classes. CSV coefficient export is a separate operation.
This v0 release deliberately consolidates previous APIs without compatibility aliases. See the migration guide, documentation and contributing guide.
Research foundations:
- Kobayashi et al. (AAAI 2019), Bézier simplex fitting.
- Tanaka et al. (AAAI 2020), asymptotic risk.
Metadata
Release files for pytorch-bsf 0.21.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 |
|---|---|---|---|---|
| pytorch_bsf-0.21.0.tar.gz | 214.8 kB | Without provenance | Details for pytorch_bsf-0.21.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytorch_bsf-0.21.0-py3-none-any.whl | Python 3 | none | any | Details for pytorch_bsf-0.21.0-py3-none-any.whl |
Total release size: 457.3 kB
Release files / pytorch_bsf-0.21.0.tar.gz
| Download URL | pytorch_bsf-0.21.0.tar.gz |
|---|---|
| Size | 214.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02c1573d79a40106e820a26ee998d11f6cd773f2a51e8bdce6a93ea965a6b53e
|
|
BLAKE2b-256 checksum How to use checksums |
c614de282b8331cd872cb0399106046a3ae445105dff13f05ff8b4c85b1114d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / pytorch_bsf-0.21.0-py3-none-any.whl
| Download URL | pytorch_bsf-0.21.0-py3-none-any.whl |
|---|---|
| Size | 242.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6595a434151537198beff06e72191e1b1e7200adc82ec8b0a6c43c39751738cc
|
|
BLAKE2b-256 checksum How to use checksums |
39d8d15423d78010492122beaa5e906319d7e5e7ada742d79ba2ffe11afc353c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for pytorch-bsf 0.21.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.