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
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 psruq_python-0.0.3.tar.gz.
File metadata
- Download URL: psruq_python-0.0.3.tar.gz
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50323bf708d6b020bf100f568226b2548a63982d970da461b0c88ea266d2438c
|
|
| MD5 |
0373c97aa3f0df460543c0c134de7208
|
|
| BLAKE2b-256 |
c73fc68909eeb4d63236afd621935f731c3daedce503e4ea9eb5fbf97fb28c1d
|
File details
Details for the file psruq_python-0.0.3-py3-none-any.whl.
File metadata
- Download URL: psruq_python-0.0.3-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afaa63bf8b0e87f83734baef041a968dc111a68abf9a482ecb0249e84dcefff7
|
|
| MD5 |
e2834a31bb7e399a080f0c1fb2400b26
|
|
| BLAKE2b-256 |
7ac12415367df2db8f6b5677f9b08dee54f2553e4208f148283bdd3766f90a1c
|