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 uv Publish PyPI PyPI - Python Version

Installation

pip install parametrix

Example

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

import jax.numpy as jnp
from parametrix import Param

class PositiveParam(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.0.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.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parametrix-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.6

File hashes

Hashes for parametrix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc5c6c1e0d79ab187ec1c05207cdbec7605927606af41e21f77b25cc32093171
MD5 68773da4c20c22dbf5adab5d7002b583
BLAKE2b-256 fecd90d74a2056efcb919b9f934a1b55cb72bd8aa3647d7e9eef46675a648876

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parametrix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.6

File hashes

Hashes for parametrix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb30fb60b1d5d9f841bd34d927a1a0d56ce79dc9a16fc956a866eb68c721785f
MD5 c0c066dbeac25ecbbd0d77b63ad0cb2d
BLAKE2b-256 d1cc9bcd870e1f1c4e34d631617da915525baad09c6d54b70c6a98fb0a54a88b

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