Package: kymatio
Kymatio: Wavelet scattering in Python - v0.3.0 “Erdre”Kymatio is an implementation of the wavelet scattering transform in the Python programming language, suitable for large-scale numerical experiments in signal processing and machine learning.
Scattering transforms are translation-invariant signal representations implemented as convolutional networks whose filters are not learned, but fixed (as wavelet filters).Use Kymatio if you need a library that:supports 1-D, 2-D, and 3-D wavelets,integrates wavelet scattering in a deep learning architecture, andruns seamlessly on CPU and GPU hardware, with major deep learning APIs, such
as PyTorch, TensorFlow, and Jax.The Kymatio environmentFlexibilityThe Kymatio organization associates the developers of several pre-existing packages for wavelet scattering, includingScatNet,scattering.m,PyScatWave,WaveletScattering.jl, andPyScatHarm.Interfacing Kymatio into deep learning frameworks allows the programmer to backpropagate the gradient of wavelet scattering coefficients, thus integrating them within an end-to-end trainable pipeline, such as a deep neural network.PortabilityEach of these algorithms is written in a high-level imperative paradigm, making it portable to any Python library for array operations as long as it enables complex-valued linear algebra and a fast Fourier transform (FFT).Each algorithm comes packaged with a frontend and backend. The frontend takes care of
interfacing with the user. The backend defines functions necessary for
computation of the scattering transform.Currently, there are eight available frontend–backend pairs, NumPy (CPU), scikit-learn (CPU), pure PyTorch (CPU and GPU), PyTorch>=1.10 (CPU and GPU), PyTorch+scikit-cuda (GPU), PyTorch>=1.10+scikit-cuda (GPU), TensorFlow (CPU and GPU), Keras (CPU and GPU), and Jax (CPU and GPU).ScalabilityKymatio integrates the construction of wavelet filter banks in 1D, 2D, and 3D, as well as memory-efficient algorithms for extracting wavelet scattering coefficients, under a common application programming interface.Running Kymatio on a graphics processing unit (GPU) rather than a multi-core conventional central processing unit (CPU) allows for significant speedups in computing the scattering transform.
The current speedup with respect to CPU-based MATLAB code is of the order of 10 in 1D and 3D and of the order of 100 in 2D.We refer to ourofficial benchmarksfor further details.How to citeIf you use this package, please cite our paperKymatio: Scattering Transforms in Python:Andreux M., Angles T., Exarchakis G., Leonarduzzi R., Rochette G., Thiry L., Zarka J., Mallat S., Andén J., Belilovsky E., Bruna J., Lostanlen V., Chaudhary M., Hirn M. J., Oyallon E., Zhang S., Cella C., Eickenberg M. (2020). Kymatio: Scattering Transforms in Python. Journal of Machine Learning Research 21(60):1−6, 2020.(paper)(bibtex)InstallationDependenciesKymatio requires:Python (>= 3.7)SciPy (>= 0.13)Standard installationWe strongly recommend running Kymatio in an Anaconda environment, because this simplifies the installation of other
dependencies. You may install the latest version of Kymatio using the package managerpip, which will automatically download
Kymatio from the Python Package Index (PyPI):pip install kymatioLinux and macOS are the two officially supported operating systems.FrontendsNumPyTo explicitly call the NumPy frontend, run:from kymatio.numpy import Scattering2D
scattering = Scattering2D(J=2, shape=(32, 32))Scikit-learnYou can call also callScattering2Das a scikit-learnTransformerusing:from kymatio.sklearn import Scattering2D

scattering_transformer = Scattering2D(2, (32, 32))PyTorchUsing PyTorch, you can instantiateScattering2Das atorch.nn.Module:from kymatio.torch import Scattering2D

scattering = Scattering2D(J=2, shape=(32, 32))TensorFlow and KerasSimilarly, in TensorFlow, you can instantiateScattering2Das atf.Module:from kymatio.tensorflow import Scattering2D

scattering = Scattering2D(J=2, shape=(32, 32))Alternatively, you can callScattering2Das a KerasLayerusing:from tensorflow.keras.layers import Input
from kymatio.keras import Scattering2D

inputs = Input(shape=(32, 32))
scattering = Scattering2D(J=2)(inputs)JaxFinally, with Jax installed, you can also instantiate a JaxScattering2Dobject:from kymatio.jax import Scattering2D

scattering = Scattering2D(J=2, shape=(32, 32))Installation from sourceAssuming the Kymatio source has been downloaded, you may install it by runningpip install -r requirements.txt
python setup.py installDevelopers can also install Kymatio via:pip install -r requirements.txt
python setup.py developGPU accelerationCertain frontends,numpyandsklearn, only allow processing on the CPU and are therefore slower. Thetorch,tensorflow,keras, andjaxfrontends, however, also support GPU processing, which can significantly accelerate computations. Additionally, thetorchbackend supports an optimizedskcudabackend which currently provides the fastest performance in computing scattering transforms.To use it, you must first install thescikit-cudaandcupydependencies:pip install scikit-cuda cupyThen you may instantiate a scattering object using thebackend='torch_skcuda'argument:from kymatio.torch import Scattering2D

scattering = Scattering2D(J=2, shape=(32, 32), backend='torch_skcuda')DocumentationThe documentation of Kymatio is officially hosted on thekymat.iowebsite.Online resourcesGitHub repositoryGitHub issue trackerBSD-3-Clause licenseList of authorsCode of conductBuilding the documentation from sourceThe documentation can also be found in thedoc/subfolder of the GitHub repository.
To build the documentation locally, please clone this repository and runpip install -r requirements_optional.txt
cd doc; make clean; make htmlSupportWe wish to thank the Scientific Computing Core at the Flatiron Institute for the use of their computing resources for testing.We would also like to thank École Normale Supérieure for their support.KymatioKyma (κύμα) meanswavein Greek. By the same token, Kymatio (κυμάτιο) meanswavelet.Note that the organization and the library are capitalized (Kymatio) whereas the corresponding Python module is written in lowercase (import kymatio).The recommended pronunciation for Kymatio iskim-ah-tio. In other words, it rhymes with patio, not with ratio.