Papers › Equinox: neural networks in JAX via callable PyTrees and filtered transformations

Equinox: neural networks in JAX via callable PyTrees and filtered transformations

30 Oct 2021arXiv:2111.00254archive 2025-07-28

Patrick Kidger, Cristian Garcia

JAX and PyTorch are two popular Python autodifferentiation frameworks. JAX is based around pure functions and functional programming. PyTorch has popularised the use of an object-oriented (OO) class-based syntax for defining parameterised functions, such as neural networks. That this seems like a fundamental difference means current libraries for building parameterised functions in JAX have either rejected the OO approach entirely (Stax) or have introduced OO-to-functional transformations, multiple new abstractions, and been limited in the extent to which they integrate with JAX (Flax, Haiku, Objax). Either way this OO/functional difference has been a source of tension. Here, we introduce `Equinox', a small neural network library showing how a PyTorch-like class-based approach may be admitted without sacrificing JAX-like functional programming. We provide two main ideas. One: parameterised functions are themselves represented as `PyTrees', which means that the parameterisation of a function is transparent to the JAX framework. Two: we filter a PyTree to isolate just those components that should be treated when transforming (`jit', `grad' or `vmap'-ing) a higher-order function of a parameterised function -- such as a loss function applied to a model. Overall Equinox resolves the above tension without introducing any new programmatic abstractions: only PyTrees and transformations, just as with regular JAX. Equinox is available at \url{https://github.com/patrick-kidger/equinox}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2111.00254")

Code

Syntology Ran 1 of 11 code samples harvested from 2 repositories linked to this paper; 10 have no recorded run. Of those that ran: 1 ran · our draft was wrong.

By repository: official repository: 10 samples from 1 repository, 0 ran; community: 1 sample from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

patrick-kidger/equinox officialmentioned in papermentioned on GitHubjaxApache-2.0 report
homerjed/sbiax mentioned on GitHubjaxMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 1 ran; 0 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
10unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

cached_filter_eval_shape patrick-kidger/equinox/equinox/_eval_shape.py official repository unverified Apache-2.0 (permissive) · efceb379a99dcddf · report
doc_repr patrick-kidger/equinox/equinox/_doc_utils.py official repository unverified Apache-2.0 (permissive) · cf6b80e4dc6b6baf · report
filter_eval_shape patrick-kidger/equinox/equinox/_eval_shape.py official repository unverified Apache-2.0 (permissive) · 513f172fd9630525 · report
filter_jvp patrick-kidger/equinox/equinox/_ad.py official repository unverified Apache-2.0 (permissive) · e27c4a46bd1b284b · report
filter_pure_callback patrick-kidger/equinox/equinox/_callback.py official repository unverified Apache-2.0 (permissive) · 7296149eeed77a64 · report
hashable_combine patrick-kidger/equinox/equinox/_compile_utils.py official repository unverified Apache-2.0 (permissive) · e7b19a731b5d767d · report
hashable_filter patrick-kidger/equinox/equinox/_compile_utils.py official repository unverified Apache-2.0 (permissive) · cbca56882036eaeb · report
hashable_partition patrick-kidger/equinox/equinox/_compile_utils.py official repository unverified Apache-2.0 (permissive) · 506ef344879884ae · report
is_array_like patrick-kidger/equinox/equinox/_filters.py official repository unverified Apache-2.0 (permissive) · e96c8fa148dc699e · report
is_inexact_array patrick-kidger/equinox/equinox/_filters.py official repository unverified Apache-2.0 (permissive) · 35fd3f64c43e53b3 · report
update_pytree ntt123/pax/pax/_src/core/module.py community ran · our draft was wrong MIT (permissive) · 54f9a104e7d281e8 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections