Skip to main content

Tools for JAX.

Project description

PyPI - Version EffVer Versioning SPEC-0 Ruff ty PyPI - Python Version

Tools for JAX

This repository implements a variety of tools for the differential programming library JAX.

Major components

Tjax’s major components are:

  • A dataclass decorator dataclass that facilitates defining structured JAX objects (so-called “pytrees”), which benefits from:

    • the ability to mark fields as static (not available in chex.dataclass), and

    • a display method that produces formatted text according to the tree structure.

  • A shim for the gradient transformation library optax that supports:

    • easy differentiation and vectorization of “gradient transformation” (learning rule) parameters,

    • gradient transformation objects that can be passed dynamically to jitted functions, and

    • generic type annotations.

  • A pretty printer print_generic for aggregate and vector types, including dataclasses. (See display.) It features:

    • support for traced values,

    • colorized tree output for aggregate structures, and

    • formatted tabular output for arrays (or statistics when there’s no room for tabular output).

Minor components

Tjax also includes:

  • Versions of custom_vjp and custom_jvp that support being used on methods: custom_vjp_method and custom_jvp_method (See shims.)

  • Tools for working with cotangents. (See cotangent_tools.)

  • JAX tree registration for NetworkX graph types. (See graph.)

  • A hashable immutable mapping frozendict that is registered as a JAX pytree, so it can be passed through transforms like jit and vmap. (See frozendict.)

  • Leaky integration leaky_integrate and Ornstein-Uhlenbeck process iteration diffused_leaky_integrate. (See leaky_integral.)

  • A testing function assert_tree_allclose that automatically produces testing code. And, a related function tree_allclose, which compares pytrees with matching structure. (See testing.)

  • Basic tools like divide_where. (See tools.)

Contribution guidelines

The implementation should be consistent with the surrounding style, be type annotated, and pass the linters below.

To run tests: uv run pytest

There are a few tools to clean and check the source:

  • uv run ruff check

  • uv run ruff format

  • uv run ty check

Project details


Release history Release notifications | RSS feed

This version

1.5.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tjax-1.5.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tjax-1.5.0-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file tjax-1.5.0.tar.gz.

File metadata

  • Download URL: tjax-1.5.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tjax-1.5.0.tar.gz
Algorithm Hash digest
SHA256 dad67d512b39fa4624c862f82d5089c99f383b6c7f68ba82c8e53022288a5ea6
MD5 3e2e5c4916331e95c4db53d9d3fe36d9
BLAKE2b-256 d97c8b8e6752581c3a3574d17d1c427dbd8203321072456f127aff1b00e2eabd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tjax-1.5.0.tar.gz:

Publisher: release.yml on NeilGirdhar/tjax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tjax-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: tjax-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tjax-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80e63fc2996125708e59e87445d01bde45f65de5cfee3bac691da1ddb31af5a2
MD5 61f7a843da0cb8b25dce86f0a0fc8909
BLAKE2b-256 950a4f5baaf923a893f5bcc284c92cc187a2b9d75f64444ebcff6f36db69836d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tjax-1.5.0-py3-none-any.whl:

Publisher: release.yml on NeilGirdhar/tjax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page