Catalog PyPI
PACKAGE EXPLORERView in registry

advect

PyPI

Automatic differentiation for the NumPy code you already write

array-apiautodiffnumpytracing
Versions collected1
Direct dependencies7From release 0.3.1
Last observed20 Oct, 20:01 UTC

README

Version 0.3.1 documentation

Advect

CI Coverage PyPI conda-forge Python versions

Advect is a focused automatic differentiation library for scientific Python, with broad NumPy API coverage and first-class support for the Python Array API standard. For repeated workloads, it can stage a function into a reusable, optimized program that can itself be differentiated, saved, and loaded.

Try it

python -m pip install advect
# or
conda install -c conda-forge advect
import numpy as np

import advect as ad


def energy(x):
    return np.sum(np.sin(x) ** 2)


x = np.array([0.0, 0.5, 1.0])
value, gradient = ad.value_and_grad(energy)(x)

print(f"loss: {value:.6f}")
print("gradient:", np.round(gradient, 6))
# loss: 0.937922
# gradient: [0.       0.841471 0.909297]

value_and_grad evaluates energy and differentiates it with respect to x. When the same kinds of inputs will run repeatedly, stage the function once:

program = ad.stage(energy, x)
restored = ad.StagedProgram.from_dict(program.to_dict())
print(f"restored loss: {restored(x):.6f}")
# restored loss: 0.937922

From the same code, Advect can compute JVPs, VJPs, Jacobians, Hessians, and higher-order or implicit derivatives. The core API also covers checkpointing and custom primitives. Optional integrations add SciPy and xarray workflows and bridges to other autodiff frameworks.

Other NumPy-focused autodiff projects include HIPS Autograd and MyGrad. Advect also offers optional bridges that let a NumPy-backed function participate in JAX or PyTorch.

Learn and contribute

Start with the runnable tutorials, then use the API reference and compatibility tables for exact contracts. Contributors should begin with CONTRIBUTING.md and the developer guide.

Report security issues through GitHub's private advisory form. Advect is distributed under the MIT License.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.14 Oct 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
yaugenst/advect

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1ce3bc027e8adf1212ec04f4d617862465feab8e8aeccbeaad7029da746aecea