Skip to main content

Flax-like computed parameters for bare JAX

Project description

Parametrix logo

flax.nnx.Param-like computed parameters for bare JAX (and Equinox).

Documentation CI Codecov Ruff ty uv Publish PyPI PyPI - Python Version

Installation

pip install parametrix

Example

The following example shows how to use Param as a base class for a parameter class that enforces positivity:

import jax.numpy as jnp
from parametrix import Param

class PositiveOnlyParam(Param):
    def __init__(self, value):
        super().__init__(jnp.log(value))

    @property
    def value(self):
        return jnp.exp(self.raw_value)

The backing values of Params are always stored as jax.Arrays, meaning that they will automatically be picked up as learnable parameters by libraries like Equinox.

Param objects also behave like numeric types, so that they are able to be used within models and any other functions without having to make any changes to the code.

Documentation

API documentation is available at Read the Docs.

Project details


Download files

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

Source Distribution

parametrix-0.1.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

parametrix-0.1.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file parametrix-0.1.4.tar.gz.

File metadata

  • Download URL: parametrix-0.1.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for parametrix-0.1.4.tar.gz
Algorithm Hash digest
SHA256 719a25f67eacea770a4b1ba22bcd0dbc7e8366ec189847652b67a776406d24e7
MD5 c4f1a275a70bd7ebefd57ce328b125c8
BLAKE2b-256 b2898296a957b47ae52e37f27152fd9116b7ea2681db6df3bfd0726f594d7816

See more details on using hashes here.

File details

Details for the file parametrix-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: parametrix-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for parametrix-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7897f8066e44287bde388073a6ade4bc230cce25a8b6bf71e0ed3845a06d1d8c
MD5 d349be357bf365dc6ace5042f3fc878e
BLAKE2b-256 96941416bc6ed8547d045050dd6d3f0cb69a9d3af161e13d7896e9ee93c478f9

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