Kymatio

Kymatio python package

Kymatio is a Python module for computing wavelet and scattering transforms.

It is built on top of PyTorch, but also has a fast CUDA backend via cupy and skcuda.

Use kymatio if you need a library that:

  • integrates wavelet scattering in a deep learning architecture,
  • supports 1-D, 2-D, and 3-D wavelets, and runs seamlessly on CPU and GPU hardware.
  • A brief intro to wavelet scattering is provided in User Guide. For a list of publications see Publications.

In the Python intepreter, you may then call:

import kymatio

which should run without error if the package has been correctly installed.

import torch
from kymatio import Scattering2D
scattering = Scattering2D(J=2, shape=(32, 32))
x = torch.randn(1, 1, 32, 32)
Sx = scattering(x)
print(Sx.size())

This should output:

torch.Size([1, 1, 81, 8, 8])

This corresponds to 81 scattering coefficients, each corresponding to an 8x8 image.

Check out the User Guide for more scattering transform examples.

comments powered by Disqus

Related