fiery-bounds
Boundary conditions (circulant, mirror, reflect) and real transforms (DCT, DST) in PyTorch.
fiery-bounds is a fiery match: it
installs on its own and imports as fiery.bounds.
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 given shape.indexingis a module that implements functions to transform 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)
Pip
Related packages
fiery-interpol: B-spline interpolation with the same boundary conditions as those implemented here.fiery-distmap: Euclidean distance transform.