forked from google-research/google-research
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md and results/figures of "cold posterior" repository.
PiperOrigin-RevId: 297791189
- Loading branch information
1 parent
6aa58f4
commit 5032e3b
Showing
14 changed files
with
6,026 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,11 @@ Instead, we argue that it is timely to focus on understanding the origin of the | |
|
||
### Cold posteriors | ||
|
||
This repository contains code to reproduces the experiments from the [paper](https://arxiv.org/pdf/2002.02405.pdf) that demonstrate _cold posterior_ effect | ||
This repository contains code to reproduce the experiments from the [paper](https://arxiv.org/pdf/2002.02405.pdf) that demonstrate _cold posterior_ effect | ||
for a ResNet-20 model on the dataset CIFAR-10 and a CNN-LSTM model on IMDB sentiment | ||
dataset. We can improve the generalization performance significantly by | ||
cooling the posterior with a temperature T<<1. The cold posterior sharply deviates | ||
from the true Bayes postterior (which is attained for T=1). | ||
from the true Bayes posterior (which is attained for T=1). | ||
|
||
ResNet-20 / CIFAR-10 | CNN-LSTM / IMDB | ||
:------------------------:|:-------------------------: | ||
|
@@ -48,7 +48,13 @@ To reproduce the ResNet-20 experiment from the paper, run the following command. | |
cold_posterior_bnn/run_resnet_experiment.sh | ||
``` | ||
|
||
For a simplified version of the experiment that only takes 1-2 days on a single GPU, run | ||
For a simplified version of the experiment that only takes 1-2 days on a single GPU, | ||
run the following command. *For the simplified experiment we halved the number of epochs | ||
and included less temperature evaluations. Due to the lower number of total epochs | ||
the individual runs are not all converged and the final performance is worse than in the | ||
full experiment. However, this experiment still shows the cold posterior effect.* | ||
|
||
 | ||
|
||
```sh | ||
cold_posterior_bnn/run_resnet_experiment_small.sh | ||
|
@@ -61,7 +67,7 @@ notebook | |
cold_posterior_bnn/plot_results.ipynb | ||
``` | ||
|
||
The results are stored in the folder ```cold_posterior_bnn/results_resnet```. | ||
The results of the simplified ResNet experiment are stored in the folder ```cold_posterior_bnn/results_resnet```. | ||
|
||
|
||
**CNN-LSTM experiment** | ||
|
@@ -102,13 +108,13 @@ Sebastian Nowozin ([[email protected]]([email protected])) | |
> Stephan Mandt, Jasper Snoek, Tim Salimans, Rodolphe Jenatton and Sebastian | ||
> Nowozin (2020). | ||
> [How Good is the Bayes Posterior in Deep Neural Networks Really?](https://arxiv.org/pdf/2002.02405.pdf). | ||
> In _arXiv preprint arXiv:12002.02405_. | ||
> In _arXiv preprint arXiv:2002.02405_. | ||
```none | ||
@article{wenzel2020good, | ||
author = {Florian Wenzel and Kevin Roth and Bastiaan S. Veeling and Jakub Swiatkowski and Linh Tran and Stephan Mandt and Jasper Snoek and Tim Salimans and Rodolphe Jenatton and Sebastian Nowozin}, | ||
title = {How Good is the Bayes Posterior in Deep Neural Networks Really?}, | ||
journal={arXiv preprint arXiv:12002.02405}, | ||
journal={arXiv preprint arXiv:2002.02405}, | ||
year = {2020}, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+617 KB
...tm/resnet_test_cross_entropy_full_run.png → ...nnlstm/cnnlstm_test_accuracy_full_run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+107 KB
cold_posterior_bnn/results_resnet/resnet_simplified_run_test_accuracy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
cold_posterior_bnn/results_resnet/resnet_simplified_run_test_cross_entropy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
id,seed,temperature,dir,ens_acc,ens_ce | ||
0,1,0.1,run_0,0.5611,1.2148816999999998 | ||
1,1,1.0,run_1,0.5631,1.216646 | ||
2,2,0.1,run_2,0.5916,1.1341463 | ||
3,2,1.0,run_3,0.5769,1.1686572 | ||
0,1,0.0001,run_0,0.9071,0.41457877 | ||
1,1,0.001,run_1,0.9086,0.37458166 | ||
2,1,0.01,run_2,0.9144,0.34805304 | ||
3,1,0.1,run_3,0.9082,0.29580609999999996 | ||
4,1,0.177828,run_4,0.9063,0.2917594 | ||
5,1,0.316228,run_5,0.9007,0.28919944 | ||
6,1,0.562341,run_6,0.8931,0.31784263 | ||
7,1,1.0,run_7,0.873,0.38322848 |