Skip to main content

Tools for JAX.

Project description

PyPI - Version EffVer Versioning SPEC-0 Ruff 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_vjp_method (See shims.)

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

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

  • 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

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.4.3.tar.gz (156.2 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.4.3-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tjax-1.4.3.tar.gz
  • Upload date:
  • Size: 156.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tjax-1.4.3.tar.gz
Algorithm Hash digest
SHA256 4d2aa5f52bb08a13a8b4b36de5662078d158c4e854546fa082d457b5e955597a
MD5 15b8c9ae0bfcdbfb68e0562caa284c26
BLAKE2b-256 57ae9609b5027bad714164bd5bf2898ff6b99790bbb84cd4e5e2a11f4b8c6f93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tjax-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tjax-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 972126b5fccf61cdd613abbb34ab909083f0c2444421dcef7032a83a5d78080b
MD5 77b8299a0fafb7750038b3501d08b305
BLAKE2b-256 06b2308d92f45117de19c2602c29e26763b0f35d87a0eb886ed4a2de3e95ce4d

See more details on using hashes here.

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