Flax-like computed parameters for bare JAX
Project description
flax.nnx.Param-like computed parameters for bare JAX (and Equinox).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
019c61f73345990f8dc7b2bbc8205e9c02e0a6d535aef0c7b6108b24cf1e064a
|
|
| MD5 |
53c3f6ad8bdc5561e33eeb3202de5c9c
|
|
| BLAKE2b-256 |
249aa03bf48da50de4e56e0f28e8e11914906eb901eca71d3c6ea622fa5f9f20
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7002975d57d29d17efbf302e2bf4332489a233fa4d804cac8caf4d5117bd253d
|
|
| MD5 |
e78282f59497514278835f334d9d0dc0
|
|
| BLAKE2b-256 |
d3bf61379aef7b8304eb9f1964068cf7724549980c48e38342b59e579c07a958
|