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.5.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.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parametrix-0.1.5.tar.gz
  • Upload date:
  • Size: 2.9 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.5.tar.gz
Algorithm Hash digest
SHA256 019c61f73345990f8dc7b2bbc8205e9c02e0a6d535aef0c7b6108b24cf1e064a
MD5 53c3f6ad8bdc5561e33eeb3202de5c9c
BLAKE2b-256 249aa03bf48da50de4e56e0f28e8e11914906eb901eca71d3c6ea622fa5f9f20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parametrix-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7002975d57d29d17efbf302e2bf4332489a233fa4d804cac8caf4d5117bd253d
MD5 e78282f59497514278835f334d9d0dc0
BLAKE2b-256 d3bf61379aef7b8304eb9f1964068cf7724549980c48e38342b59e579c07a958

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