Skip to main content

Code for uncertainty quantification with proper scoring rules.

Project description

Predictive Uncertainty Quantification via Risk Decompositions for Strictly Proper Scoring Rules

This repository contains code for the paper "Predictive Uncertainty Quantification via Risk Decompositions for Strictly Proper Scoring Rules," submitted to NeurIPS 2024.

UV

We use uv to manage dependecies. You can find an installation guide and documentation here.

Install uv

For Linux/MacOS the following line will install uv on your system:

curl -LsSf https://astral.sh/uv/install.sh | sh

Install dependencies

All the commands should be executed from the folder with pyproject.toml file

To install dependencies from pyproject.toml file using

uv sync

It will create a .venv folder, that will contain a virtual environment and all the needed dependencies.

Run python script

uv installs dependencies in special virutal env, that is located in .venv/. To run any python code snippet with it you should run:

uv run python ...

e.g.

cd experiments/laplace
uv run python main.py -f checkpoints/resnet18_ce.pth -d cifar10_one_batch -v

Repository Structure

The repository is organized as follows:

Experiments

This folder contains different experiments related to the paper.

  • cifar10: Contains training scripts for cifar10 dataset.
  • laplace: Contains inference scripts for Laplace Redux – Effortless Bayesian Deep Learning model.

Embedding Extraction

  • source/source/evaluation_utils.py: Script to extract embeddings after the ensembles are trained.

Notebooks

Folder notebooks/ have notebooks with data analysis of experiments.

  • joint_tables.ipynb: Prepares comprehensive pandas tables for both problems.
  • ood_analysis.ipynb: Generates plots for the OOD problem.
  • ood_visualizations.ipynb: Creates visualizations for the OOD problem.
  • mis_analysis.ipynb: Generates plots for the misclassification problem.
  • mis_visualizations.ipynb: Creates visualizations for the misclassification problem.

Notes on Trained Models

Due to a supplementary material size limit of 100MB, we cannot include the trained models in this repository. However, we are ready to provide them through any resource that maintains anonymity upon request.

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

psruq_python-0.0.4.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psruq_python-0.0.4-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file psruq_python-0.0.4.tar.gz.

File metadata

  • Download URL: psruq_python-0.0.4.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.18

File hashes

Hashes for psruq_python-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b9332b8d44622d0781228da15b0e55b575b7745653f424036cb3393b786e1659
MD5 8b589bffe252dd9c90307b028b7dd6e2
BLAKE2b-256 ce73f91acb51c21b8441cbd191e3169fe96c8ab055b34dbc95a07f1957e4b47d

See more details on using hashes here.

File details

Details for the file psruq_python-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for psruq_python-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50fea844a6c03a37cda3e556487455d7fa7d5fe9c216d780d23da947505a841d
MD5 ae930f571570f2fcefde8326e6856980
BLAKE2b-256 afa38e2f467112826925c5b9ee81b45597f535ba2959371811c7ef72ceffd4f5

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