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.6.tar.gz (2.9 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.6-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parametrix-0.1.6.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"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.6.tar.gz
Algorithm Hash digest
SHA256 dbf5983a4e8e8f03c885281f74cee5673844e915999502a6d73e228ee7194216
MD5 76ecb4b5906340d3f7ddec9086818614
BLAKE2b-256 d029c44b02d807a0dddfb79dbf51ccf06f090701e7d3f4fa3fdf4a94c532f1d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parametrix-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a96c4901adb4eaf4a15a1551b27c586e41e2a43568553e0c5acc317ddcec7be1
MD5 f6bf58feddf18ca8fe169ca21bfd0706
BLAKE2b-256 40f9ce0809a1fb6353bf6bdeffc888fc074a710065e8aa3f73ef246d51f32a1a

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