Skip to main content

Cubic B-spline interpolation on multidimensional grids in PyTorch

Project description

torch-cubic-b-spline-grid

License PyPI Python Version CI codecov

Cubic B-spline interpolation on multidimensional grids in PyTorch.

The primary goal of this package is to provide a learnable, continuous parametrization of 1-4D spaces.


This is a PyTorch implementation of the model used in Warp for continuous deformation fields and locally variable optical parameters in cryo-EM images. The approach is described in Dimitry Tegunov's paper:

Many methods in Warp are based on a continuous parametrization of 1- to 3-dimensional spaces. This parameterization is achieved by spline interpolation between points on a coarse, uniform grid, which is computationally efficient. A grid extends over the entirety of each dimension that needs to be modeled. The grid resolution is defined by the number of control points in each dimension and is scaled according to physical constraints (for example, the number of frames or pixels) and available signal. The latter provides regularization to prevent overfitting of sparse data with too many parameters. When a parameter described by the grid is retrieved for a point in space (and time), for example for a particle (frame), B-spline interpolation is performed at that point on the grid. To fit a grid’s parameters, in general, a cost function associated with the interpolants at specific positions on the grid is optimized.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_cubic_b_spline_grid-0.0.2.tar.gz (148.6 kB view details)

Uploaded Source

Built Distribution

torch_cubic_b_spline_grid-0.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file torch_cubic_b_spline_grid-0.0.2.tar.gz.

File metadata

File hashes

Hashes for torch_cubic_b_spline_grid-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2c0e91fd7af0f39881464f9b50c8c76335d4f2dd3710f372f218adc2e4c502c5
MD5 66be0d334c3e571901be539db7db8ea8
BLAKE2b-256 edc6c88805442c2434d1895b990198f4818ee9e8b3023eebe0b07f7064921f8b

See more details on using hashes here.

File details

Details for the file torch_cubic_b_spline_grid-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_cubic_b_spline_grid-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2300ea9a90cbbd0e688e17c4cfc14779a74addc948f00a8ee69c8dbf396e1bb
MD5 af509df0347efbc9605ab69a3a6732e5
BLAKE2b-256 cf00afd1214099545c4af1927936dce390803ded5abac235c063c1fb7d05f74c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page