Skip to main content

PyTorch-BSF

PyTorch-BSF — Bézier Simploid Fitting

CodeQL PyTest Release Conda GHPages codecov PyPI Downloads

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)
  • BezierSpace holds immutable geometry and shared coefficient ordering.
  • BezierModel is a differentiable PyTorch module containing coefficients.
  • fit(space, samples) always returns FitResult: model, metrics, diagnostics and stopping state.
  • Dense SVD and optional sparse LSMR solve the same weighted, penalized objective in CPU float64.
  • Objective minimization uses minimize with explicit PreconditionedSGD settings.
  • 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:

Metadata

Release files for pytorch-bsf 0.22.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-bsf 0.22.0
File Size Uploaded Provenance Actions
pytorch_bsf-0.22.0.tar.gz 225.3 kB Without provenance Details for pytorch_bsf-0.22.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-bsf 0.22.0
File Interpreter ABI Platform Actions
pytorch_bsf-0.22.0-py3-none-any.whl Python 3 none any Details for pytorch_bsf-0.22.0-py3-none-any.whl

Total release size: 479.2 kB

Release files / pytorch_bsf-0.22.0.tar.gz

Download URL pytorch_bsf-0.22.0.tar.gz
Size 225.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8d9fd8482a262205c12006a1438e4b76dfbb1439c9d04df9e73226142d6c9e8f
BLAKE2b-256 checksum
How to use checksums
3d9077aefaa37371dd73885497cbb7c48255fdf34aac5d65b1a238b5e0943ce8
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.22.0-py3-none-any.whl

Download URL pytorch_bsf-0.22.0-py3-none-any.whl
Size 253.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e44cbcee632f02dd279a638ae1197ea122210aeda89091548a2d23cd3f98b46c
BLAKE2b-256 checksum
How to use checksums
3509a90d55ff4b2ef00a52c279e265f1b3edd2d9920263619d9381d4a4c72334
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.22.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.

Release history Release notifications | RSS feed

This release

0.22.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page