Code for the AISTATS 2022 paper titled "Being a Bit Frequentist Improves Bayesian Neural Networks" by Agustinus Kristiadi, Matthias Hein, and Philipp Hennig.
- Run:
conda create --name ENV_NAME --file conda_env.txt
. - Then:
conda activate ENV_NAME
. - Install PyTorch and TorchVision (https://pytorch.org/get-started/locally/).
- Set the dataset path in
util/dataloaders.py
, line 30 (path = os.path.expanduser('~/Datasets')
). - Follow the instruction here to obtain the NLP datasets: https://github.com/hendrycks/outlier-exposure/tree/master/NLP_classification.
- Model training: run
train.sh
,train_nlp.sh
, andtrain_aux.sh
. - Run
eval.sh
andeval_nlp.sh
to gather experiments data. - Run
aggregate_*.py
to create the tables in the paper based on the previous data. - Run
plot_*.py
to create figures for dataset shift experiments.
@inproceedings{kristiadi2022frequentist,
title={Being a Bit Frequentist Improves {B}ayesian Neural Networks},
author={Kristiadi, Agustinus and Hein, Matthias and Hennig, Philipp},
booktitle={AISTATS},
year={2022}
}