Skip to content

pyijiezhang/cpe-underfit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Cold Posterior Eect Indicates Underfitting, and Cold Posteriors Represent a Fully Bayesian Method to Mitigate It

This repo provides the codes for reproducing the experiments in the paper The Cold Posterior Eect Indicates Underfitting, and Cold Posteriors Represent a Fully Bayesian Method to Mitigate It. This implementation is built on this repo.

Setup

All requirements are listed in environment.yml. Create a conda environment using:

conda env create -n <env_name>

Next, ensure Python modules under the src folder are importable as,

export PYTHONPATH="$(pwd)/src:${PYTHONPATH}"

Usage

Neural networks with approximate inference

The main script to run all SGMCMC experiments is experiments/train_lik.py.

As an example, to run cyclical SGHMC with our proposed noisy Dirichlet likelihood on CIFAR-10 with label noise, run:

python experiments/train_lik.py --dataset=cifar10 \
                                --dirty_lik=resnet18std \
                                --likelihood=softmax \
                                --augment=False \
                                --perm=False \
                                --likelihood_temp=0.5 \
                                --temperature=1.0 \
                                --logits_temp=1.0 \
                                --prior-scale=0.0005 \
                                --sgld-epochs=1000 \
                                --sgld-lr=2e-7

Each argument to the main method can be used as a command line argument due to Fire. Weights & Biases is used for all logging.

Linear models with exact inference

The results of linear models can be reproduced in blm/blm_regression_eact.ipynb.

Bibtex

It will be updated soon.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors