Shearlet Transform

class torch_radon.shearlet.ShearletTransform(width, height, alphas, cache=None)[source]

Implementation of Alpha-Shearlet transform based on https://github.com/dedale-fet/alpha-transform/tree/master/alpha_transform.

Once the shearlet spectrograms are computed all the computations are done on the GPU.

Parameters
  • width – Width of the images

  • height – Height of the images

  • alphas – List of alpha coefficients that will be used to generate shearlets

  • cache – If specified it should be a path to a directory that will be used to cache shearlet coefficients in order to avoid recomputing them at each instantiation of this class.

Note

Support both float and double precision.

forward(self, x)

Do shearlet transform of a batch of images.

Parameters

x – PyTorch GPU tensor with shape \((d_1, \dots, d_n, h, w)\).

Returns

PyTorch GPU tensor containing shearlet coefficients. Has shape \((d_1, \dots, d_n, \text{n_shearlets}, h, w)\).

backward(self, cs)

Do inverse shearlet transform.

Parameters

cs – PyTorch GPU tensor containing shearlet coefficients, with shape \((d_1, \dots, d_n, \text{n_shearlets}, h, w)\).

Returns

PyTorch GPU tensor containing reconstructed images. Has shape \((d_1, \dots, d_n, h, w)\).