Boundary conditions and real transforms in PyTorch
Project description
torch-bounds
Boundary conditions (circulant, mirror, reflect) and real transforms (DCT, DST) in PyTorch.
Overview
This small package implements a wide range of boundary conditions used to extrapolate a given discrete signal outside of its native bounds.
Based on these additional boundary conditions, it implements:
It also implements discrete
sine and cosine transforms
(variants 1, 2 and 3), using a trick similar to cupy.
Finally, it implements additional utilities:
ensure_shapecrops or pads a tensor (with any boundary condition) so that it matches a give shape.indexingis a module that implements functions to tranforms out-of-bounds coordinates into in-bounds coordinates according to any boundary condition.typesis a module that defines names and aliases for different boundary conditions, as well as tools to convert between different naming conventions.
Documentation
See our documentation and notebooks.
Installation
Dependency
torch >= 1.3torch >= 1.8if real transforms are needed (dct, dst)
Conda
conda install torch-bounds -c balbasty -c pytorch
Pip
pip install torch-bounds
Related packages
torch-interpol: B-spline interpolation with the same boundary conditions as those implemented here.torch-distmap: Euclidean distance transform.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torch_bounds-0.2.0.tar.gz.
File metadata
- Download URL: torch_bounds-0.2.0.tar.gz
- Upload date:
- Size: 42.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
731835f9f150486f221984d4ac048ce0df721e3e3f7d455f43ceab917990a699
|
|
| MD5 |
c0da6aadb2f49d1dbfe45ceb8c88dd64
|
|
| BLAKE2b-256 |
5cd743bb22df5cb664632207c8b1e58a18884c79542da36d0107042fba5ed10a
|
File details
Details for the file torch_bounds-0.2.0-py3-none-any.whl.
File metadata
- Download URL: torch_bounds-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4975ba7b9eef746fd716b15493b5e6360217233fcd80de127dfdd7da1bdfb97a
|
|
| MD5 |
61df03293d08014588e7e1a64cc588be
|
|
| BLAKE2b-256 |
f02cbde84551a94a2a90d9695cee0e09e23d4521a09888bea4cc6ec8cc6dbb61
|