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.2.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.2-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: psruq_python-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f59edcda8ee5e53914e0695048025cb1fdd5d63c2bedd7d6c3a0111b7aa9bda5
MD5 1e74a428e9260e5d219a2b8ba5a2f27c
BLAKE2b-256 dce81ae53165a9dba56da11f78ae1eb255df94e69c45236e6a3ec3cc6e4b4858

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for psruq_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fcf7b522d6086c4e64ad70ec28407f079221a6a1e868bbd26a5b1b91a2edade4
MD5 880296fa9e082edf02abd3362fdaafb1
BLAKE2b-256 5367000774c5d1015c6203a56fa6441cb931d32ada39910e974bd337e92cbe72

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