softclip
Simple JAX implementation of softclip, inspired by tensorflow probability
softclip is a differentiable bijector from the real number space to some interval. This is useful when you want to optimize a parameter that is assumed to be inside the interval [low, high].
Installation
softclip can be installed with pip directly from GitHub, with the following command:
pip install git+https://github.com/yonesuke/softclip.git
QuickStart
The forward method is the function from the real number space to the interval [low, high].
The inverse method is the function from the interval [low, high] to the real number space, and is the inverse function of forward.
from softclip import SoftClip
bij = SoftClip(low=1.0, high=3.0, hinge_softness=0.5)
y = bij.forward(2.0) # y = 2.9640274
bij.inverse(y) # 1.9999975 ≒ 2.0
Simply set low=0.0 or high=0.0 to create a bijector to a positive/negative number domain.
bij_positive = SoftClip(low=0.0)
bij_negative = SoftClip(high=0.0)
By transforming softclip to distrax with to_distrax, you can create distrax bijectors:
bij_distrax = bij.to_distrax()
Metadata
Release files for softclip 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| softclip-0.1.0.tar.gz | 3.1 kB | Without provenance | Details for softclip-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| softclip-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for softclip-0.1.0-py3-none-any.whl |
Total release size: 6.5 kB
Release files / softclip-0.1.0.tar.gz
| Download URL | softclip-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
145f05163abc33cd6a8959100831278e1640378bfe21f2cef5901c2a255cd896
|
|
BLAKE2b-256 checksum How to use checksums |
1d78a00f0517f0e3424aa91f921d377ac8d923fbf84de122466e5e1ea668fe85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / softclip-0.1.0-py3-none-any.whl
| Download URL | softclip-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5a5f0bee9556d44b9eafdbc89d92dd9aa1445616cbee3ddd6b163dad005b011
|
|
BLAKE2b-256 checksum How to use checksums |
47c77c5a501499708821b18c03657b6ce432ccf25a669c7c3077172985fe1d97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for softclip 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.