Taylor-mode automatic differentiation for PyTorch
Project description
Taylor Mode Autodiff in PyTorch
This library provides a PyTorch implementation of Taylor mode automatic differentiation, a generalization of forward mode to higher-order derivatives.
It is similar to JAX's Taylor mode (jax.experimental.jet).
The repository also hosts the Python functionality+experiments and LaTeX source for our NeurIPS 2025 paper "Collapsing Taylor Mode Automatic Differentiation", which allows to further accelerate Taylor mode for many practical differential operators.
Operator coverage is still growing, so please help us improve the package by providing feedback, filing issues, and opening pull requests.
Getting Started
Installation
pip install jet-for-pytorch
Quickstart
Compute the third-order derivative of a scalar function with jet:
from torch import tensor, ones_like, zeros_like
from jet import jet
f = lambda x: x**4 # f'''(x) = 24 * x
x = tensor(2.0)
f_jet = jet(f, (x,)) # (x₀, x₁, x₂, x₃) ↦ (f₀, f₁, f₂, f₃)
# x₀ = x, x₁ = 1, x₂ = x₃ = 0 ⇒ f₃ = f'''(x)
f0, f1, f2, f3 = f_jet((x, ones_like(x), zeros_like(x), zeros_like(x)))
assert f3.allclose(24 * x) # third derivative matches by hand
For the full list of supported operators, see the supported operations section of the introductory tutorial.
Examples
See the documentation.
Citing
If you find the jet package useful for your research, consider citing
@inproceedings{dangel2025collapsing,
title = {Collapsing Taylor Mode Automatic Differentiation},
author = {Felix Dangel and Tim Siebert and Marius Zeinhofer and Andrea
Walther},
year = 2025,
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jet_for_pytorch-1.0.0.tar.gz.
File metadata
- Download URL: jet_for_pytorch-1.0.0.tar.gz
- Upload date:
- Size: 6.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ece4e257951abe63970f7e71c80b32c21051428ac27b04feb2a807c0a67204a
|
|
| MD5 |
24dde7195c0d7201c1c08d58f6485005
|
|
| BLAKE2b-256 |
6d97fb5d34a84202a5ed589ee65e375ece8e42c01d5b5c9b46ff4fa7bb93227e
|
Provenance
The following attestation bundles were made for jet_for_pytorch-1.0.0.tar.gz:
Publisher:
python-publish.yaml on f-dangel/torch-jet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jet_for_pytorch-1.0.0.tar.gz -
Subject digest:
2ece4e257951abe63970f7e71c80b32c21051428ac27b04feb2a807c0a67204a - Sigstore transparency entry: 1803923851
- Sigstore integration time:
-
Permalink:
f-dangel/torch-jet@2e49005ee4ae145f375925e38f0a255f82369dda -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/f-dangel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@2e49005ee4ae145f375925e38f0a255f82369dda -
Trigger Event:
release
-
Statement type:
File details
Details for the file jet_for_pytorch-1.0.0-py3-none-any.whl.
File metadata
- Download URL: jet_for_pytorch-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d36b0fe323717acd4208e99194a7e2e316bc013f5c8c480560bef56848bc09d7
|
|
| MD5 |
196e439a7362c5f2440a1fa39116fe4b
|
|
| BLAKE2b-256 |
06151ec3404d8ff98b6251027c6787133eba9f17bddb72a72171479a98c38ed5
|
Provenance
The following attestation bundles were made for jet_for_pytorch-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yaml on f-dangel/torch-jet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jet_for_pytorch-1.0.0-py3-none-any.whl -
Subject digest:
d36b0fe323717acd4208e99194a7e2e316bc013f5c8c480560bef56848bc09d7 - Sigstore transparency entry: 1803923907
- Sigstore integration time:
-
Permalink:
f-dangel/torch-jet@2e49005ee4ae145f375925e38f0a255f82369dda -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/f-dangel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@2e49005ee4ae145f375925e38f0a255f82369dda -
Trigger Event:
release
-
Statement type: