spyrit.core.torch
Contains pytorch-based functions used in spyrit.core modules.
The goal of this module is to provide a set of functions that use various pytorch functionalities and optimizations to perform the necessary operations in the spyrit.core modules. It mirrors the the spyrit.misc most used functions, but using pytorch tensors instead of numpy arrays.
Functions
|
Returns a permutation matrix based on the significance tensor. |
|
Asserts that n is a power of 2. |
|
Crops the center of an image to the specified shape. |
|
Pads an image to the specified shape by centering it. |
|
Creates a finite difference matrix of shape \((n^2,n^2)\) for a 2D image of shape \((n,n)\). |
|
Creates a finite difference matrix of shape \((h*w,h*w)\) for a 2D image of shape \((h,w)\). |
|
Sorts a tensor along a specified axis using the indices tensor. |
|
Returns a tensor sorted by decreasing significance of its elements as determined by the significance tensor. |
|
Similar to torch.sparse.spdiags. Arguments are the same, excepted : |
Returns Walsh-ordered Hadamard matrix in 2D. |
|
|
Returns a 2D Walsh-ordered Hadamard transform of an image. |
|
Returns a 1D Walsh-ordered Hadamard transform matrix of size \(n \times n\). |