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.
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}"
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-7Each argument to the main method can be used as a command line argument due to Fire.
Weights & Biases is used for all logging.
The results of linear models can be reproduced in blm/blm_regression_eact.ipynb.
It will be updated soon.