Skip to main content

multiplicity

CI Black python pytorch License

Library for evaluating predictive multiplicity of deep leearning models.

Setup

pip install multiplicity

Quickstart

The library provides a method to estimate viable prediction intervals: prediction intervals that are robust to a small change in model's loss at training or evaluation time.

Import the library:

from multiplicity import torch as multiplicity

Suppose we have a trained torch binary classifier which outputs softmax probabilities:

model(x)  # 0.75

Specify to the deviation of which metric we want to be robust to, and on which dataset:

robustness_criterion = multiplicity.ZeroOneLossCriterion(train_loader)

Then, we can compute the viable prediction range for a given example x like so:

lb, pred, ub = multiplicity.viable_prediction_range(
    model=model,
    target_example=x,
    robustness_criterion=robustness_criterion,
    criterion_thresholds=epsilon,
)
# lb=0.71, pred=0.75, ub=0.88

Metadata

Release files for multiplicity 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multiplicity 2.1.0
File Size Uploaded
multiplicity-2.1.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multiplicity 2.1.0
File Interpreter ABI Platform
multiplicity-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / multiplicity-2.1.0.tar.gz

Download URL multiplicity-2.1.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b3187a22e3b680cf4b7821f3b25392a837e928f9ef2254a0f3353dcf43ab4a07
BLAKE2b-256 checksum
How to use checksums
14513629eede6abdc73a912bb1fc0d3eaad64867f7aa8a44004cbd5d0adf7dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic

Release files / multiplicity-2.1.0-py3-none-any.whl

Download URL multiplicity-2.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9d352eb892861ddfa07c166fd2382f62cec9077bc87c7abca4fddbcfc5ae027
BLAKE2b-256 checksum
How to use checksums
f0c54c2c65d2048f59bf32a40b73e207b4aa8f03ff87760f1b8bdc27e53ea20d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page