padaquad#

padaquad computes definite integrals \(\int_a^b f(t)\,dt\) of a function you can evaluate, in PyTorch. It splits \([a, b]\) into subintervals, refines the ones whose error is too large, and evaluates the integrand at many points of many subintervals in one call, on a CPU or a GPU. Gradients flow through the result, so the integral can be part of a training loss.

pip install padaquad
Getting started

Install padaquad, compute a first integral, and see what it is for and what it is not for.

Getting started
User guide

How the integration works, how to choose a method, how the error is controlled, gradients, repeated calls, and memory.

User guide
API reference

Every public function, class and result field, generated from the docstrings.

API reference
Examples

Runnable scripts with their output, including the checks of each method’s accuracy that you can run yourself.

Examples