GithubHelp home page GithubHelp logo

cappelletto / bayesian_nn_ensembles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teapearce/bayesian_nn_ensembles

0.0 1.0 0.0 10.38 MB

AISTATS paper 'Uncertainty in Neural Networks: Approximately Bayesian Ensembling'

License: MIT License

JavaScript 7.66% Python 18.05% HTML 0.60% Jupyter Notebook 73.69%

bayesian_nn_ensembles's Introduction

Uncertainty in Neural Networks: Approximately Bayesian Ensembling

Code from AISTATS 2020 paper 'Uncertainty in Neural Networks: Approximately Bayesian Ensembling' - https://arxiv.org/abs/1810.05546

15 minute introduction here. Play with the interactive demo here. See how it compares to dropout here.

notebook_examples provides lightweight demo code for a Bayesian anchored ensemble in PyTorch / Keras / Tensorflow for regression and classification.

Main Files

  • script_methods.py - this creates figure 4 of the paper, running 1-D regression example for GP, MC dropout, and Anchored Ensemble. Due to compatibility issues with Edward, HMC and VI are now handled elsewhere.
  • pymc_HMC_VI.py - creates VI and HMC plots for figure 4 of paper.
  • main_exp.py - runs UCI benchmarking experiments.
  • main_converge.py - runs convergence comparison between GP and anchored ensembles as in figure 7 on Boston dataset.
  • script_anch_need.py - creates regression portion of figure 6, showing why anchored ensembles is a better approximation of the Bayesian posterior than other ensembling methods.
  • 2d_class_need_03.py - creates classification portion of figure 6.
  • 2d_anch_plots_algorithm.py - creates visualisation of the algorithm in figure 2.
  • 2d_post_comparison.py - creates visualisation of the posterior comparison made in figure 3 between analytical, RMS and MFVI.

Supporting Files

  • DataGen.py - handles data set generation or read in.
  • hyperparams.py - holds hyperparameters used in UCI benchmarking.
  • utils.py - handles some plotting and support functions.
  • module_gp.py - code behind the equivalent gaussian processes.
  • module_NN_ens.py - code for anchored ensembling, includes the regularisation around initialisation values (the ‘anchor’ method). Is only set up for single or double layer fully connected NN.

Requirements

Below are the package versions used in writing the code.

Python 3.7.0

tensorflow
'1.12.0'

numpy
'1.15.3'

matplotlib
'3.0.1'

sklearn
'0.20.0'

pymc3
'3.5'

theano (used with pymc3)
'1.0.3'

bayesian_nn_ensembles's People

Contributors

teapearce avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.