A PyTorch-based distribution parametrized by the logits of CDF bins
Project description
binned-cdf
A PyTorch-based distribution parametrized by the logits of CDF bins
Background
The Cumulative Distribution Function (CDF) is a fundamental concept in probability theory and statistics that describes the probability that a random variable $X$ takes on a value less than or equal to a given threshold $x$. Formally, the CDF is defined as $F(x) = P(X \leq x)$, where $F(x)$ ranges from 0 to 1 as $x$ varies from negative to positive infinity. The CDF provides a complete characterization of the probability distribution of a random variable: for continuous distributions, it is the integral of the probability density function (PDF), while for discrete distributions, it is the sum of probabilities up to and including $x$. Key properties of any CDF are the monotonicity and the boundary conditions $\lim_{x \to -\infty} F(x) = 0$ and $\lim_{x \to \infty} F(x) = 1$. CDFs are particularly useful for computing probabilities of intervals, quantiles, and for statistical inference.
Application to Machine Learning
This repository uses the CDF to model and learn flexible probability distributions in machine learning tasks. By parameterizing the CDF with binned logits, it enables differentiable training and efficient sampling, making it suitable for uncertainty estimation, probabilistic prediction, and distributional modeling in neural networks.
Implementation
The BinnedLogitCDF class inherits directly from torch.distributions.Distribution, implementing all necessary
methods plus some convenience functions.
It supports multi-dimensional batch shapes and CUDA devices.
The bins can be initialized linearly or log-spaced.
torch>=2.7 it the only non-dev dependency of this repo.
:point_right: Please have a look at the documentation to get started.
Project details
Release history Release notifications | RSS feed
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 binned_cdf-1.0.4.tar.gz.
File metadata
- Download URL: binned_cdf-1.0.4.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb9f5c5a3aa82333c3c395d4f54bf396156d59da85bc71dbca7ec4cc7b3091c
|
|
| MD5 |
fec791f7b09be648fe6e0ac1773a88c2
|
|
| BLAKE2b-256 |
8343262ddb43cd7e474d13f80f768c4f9b4e81d9b3cb914cb29b1e9118fb9fb9
|
Provenance
The following attestation bundles were made for binned_cdf-1.0.4.tar.gz:
Publisher:
cd.yaml on famura/binned-cdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binned_cdf-1.0.4.tar.gz -
Subject digest:
afb9f5c5a3aa82333c3c395d4f54bf396156d59da85bc71dbca7ec4cc7b3091c - Sigstore transparency entry: 1171254023
- Sigstore integration time:
-
Permalink:
famura/binned-cdf@1c5628bf39ffd3b1fe8c7accd304c76c5d2aab14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/famura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@1c5628bf39ffd3b1fe8c7accd304c76c5d2aab14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file binned_cdf-1.0.4-py3-none-any.whl.
File metadata
- Download URL: binned_cdf-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c7f37133cd19be8367baa6b0a56974eaaee8ec8de308c8eaef5807b371c0f4
|
|
| MD5 |
b942a59f5efed930464ebd7317cbcf8f
|
|
| BLAKE2b-256 |
311aa88917081b9352996efacfb2114e5bd3ee80c009509ae1e0d440af54d7c0
|
Provenance
The following attestation bundles were made for binned_cdf-1.0.4-py3-none-any.whl:
Publisher:
cd.yaml on famura/binned-cdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binned_cdf-1.0.4-py3-none-any.whl -
Subject digest:
b6c7f37133cd19be8367baa6b0a56974eaaee8ec8de308c8eaef5807b371c0f4 - Sigstore transparency entry: 1171254057
- Sigstore integration time:
-
Permalink:
famura/binned-cdf@1c5628bf39ffd3b1fe8c7accd304c76c5d2aab14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/famura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@1c5628bf39ffd3b1fe8c7accd304c76c5d2aab14 -
Trigger Event:
push
-
Statement type: