Skip to main content

Tools for JAX.

Project description

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

Major components

Tjax’s major components are:

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

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

    • a MyPy plugin, and

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

  • A fixed_point finding library heavily based on fax. Our library

    • supports stochastic iterated functions, and

    • uses dataclasses instead of closures to avoid leaking JAX tracers.

  • 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.

Minor components

Tjax also includes:

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

  • Versions of custom_vjp and custom_jvp that support being used on methods. (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.)

  • An improved version of jax.tree_util.Partial. (See partial.)

  • A Matplotlib trajectory plotter PlottableTrajectory. (See plottable_trajectory.)

  • A testing function assert_tree_allclose that automatically produces testing code. And, a related function tree_allclose. (See testing.)

  • Basic tools like divide_where. (See tools.)

Also, see the documentation.

Contribution guidelines

  • Conventions: PEP8.

  • How to run tests: pytest .

  • How to clean the source:

    • isort .

    • mypy .

    • pylint tjax tests

    • pflake8 .

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-0.23.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

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

tjax-0.23.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tjax-0.23.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3.dev0 CPython/3.10.4 Linux/5.15.0-53-generic

File hashes

Hashes for tjax-0.23.0.tar.gz
Algorithm Hash digest
SHA256 780a3b26b58efdd18f7c81ba358cfe1001c81b4f34b26c4cf67dc726817e3062
MD5 1602652c6b66a45f50f8b668aab2880f
BLAKE2b-256 1e9196ed4868abeddb95119e49725a3fac9760e7980df052b6d897a1449eb577

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tjax-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3.dev0 CPython/3.10.4 Linux/5.15.0-53-generic

File hashes

Hashes for tjax-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7049de75bbdbd7b30ffd3bac257457e60b693dec2b0849bf8aa9067f1db6115
MD5 6575563063a8e1b1f9de8db259582acd
BLAKE2b-256 210dcb1f19887f7cb620a839d2d519faa6b21ee7ac991f552424a0b66151f5d2

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