Giter Club home page Giter Club logo

bayesian_nn_ensembles's Introduction

Uncertainty in Neural Networks: Bayesian Ensembling

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

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.

[FULL EXPERIMENTAL CODE TO BE UPLOADED SOON]

For queries, email me at tp424 [at] cam.ac.uk.

Trimmed Down Code

Folder 03_trimmed_down provides a carved out piece of code from the full experimental code (still to be uploaded).

  • script_methods.py - main program, run this file to produce some graphs
  • DataGen.py - handles data set generation or read in
  • utils.py - handles some plotting and support functions
  • module_gp.py - code behind the equivalent gaussian processes
  • module_NN_ens.py - where the magic happens! - includes the regularisation around initialisation values (the ‘anchor’ method, line 155). Is only set up for single or double layer fully connected NN.

Other thoughts:

  • Does NOT include modules for the other methods, such as variational inference and HMC
  • I’m not sure how robust the code will be to deviations from the specific versions of packages (I had conflict issues between Tensorflow and Edward) and python (3.6) I used, so may require some tweaking depending on what you’re running
  • code in module_NN_ens.py (and more generally everywhere) is much more complex than needed - I added a lot of extra functionality during development and testing, trying things out which aren’t necessarily needed in the final version.
  • Hopefully variable names etc should be obvious enough, parameters I think you’ll want to vary are mainly controlled in the inputs section in script_methods.py

bayesian_nn_ensembles's People

Contributors

teapearce 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.