Examples

These short examples showcase the features of the pykeops.numpy and pykeops.torch modules, from automatic differentiation to block-sparse reductions.

Note

If you run a KeOps script for the first time, the internal engine may take a few minutes to compile all the relevant formulas. Do not worry: this work is done once and for all as KeOps stores the resulting shared object files (‘.so’) in a cache directory.

Numpy API

Sum reduction

Sum reduction

GPU Selection

GPU Selection

Block-sparse reductions

Block-sparse reductions

Arg-K-Min reduction

Arg-K-Min reduction

KernelSolve reduction

KernelSolve reduction

KernelSolve reduction (with LazyTensors)

KernelSolve reduction (with LazyTensors)

SumSoftMaxWeight reduction

SumSoftMaxWeight reduction

SumSoftMaxWeight reduction (with LazyTensors)

SumSoftMaxWeight reduction (with LazyTensors)

Pytorch API

Advanced syntax in formulas

Advanced syntax in formulas

Anisotropic kernels

Anisotropic kernels

Sum reduction

Sum reduction

LogSumExp reduction

LogSumExp reduction

Vectorial LogSumExp reduction

Vectorial LogSumExp reduction

Multi GPU

Multi GPU

Block-sparse reductions

Block-sparse reductions

GPU Selection

GPU Selection

KernelSolve reduction

KernelSolve reduction

KernelSolve reduction (with LazyTensors)

KernelSolve reduction (with LazyTensors)

SumSoftMaxWeight reduction

SumSoftMaxWeight reduction

Gallery generated by Sphinx-Gallery