Coder Social home page Coder Social logo

marglik's Introduction

Marglik: Scalable Marginal Likelihood Estimation for Model Selection in Deep Learning

Code for the paper:

Immer, Bauer, Fortuin, Rätsch, Khan. Scalable Marginal Likelihood Estimation for Model Selection in Deep Learning. ICML 2021.

In this repository, the Algorithm proposed in our paper is implemented in marglik.py. The code uses the laplace-torch package, a stand-alone package that originates from our implementation for this paper but provides additional features related to predictions (see also linearized-predictives) and last-layer Laplace approximations.

Setup

Python 3.8 is required although it might work with later or earlier versions potentially. Install minimal dependencies pip install -r requirements.txt.

Usage

The method marglik_optimization(...) in marglik.py requires at least a pytorch model and training loader. The method trains the neural network and optimizes the prior precision and observation noise (for regression). For details, see the signature of the method or consult the documentation of the separately published laplace-torch library here.

marglik's People

Contributors

aleximmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

marglik's Issues

About hyperparameter optimization

Hi, I really enjoyed your impressive paper.

I read marglik.py and tried to replicate the optimization of the temperature parameter written in the paper as eq (7). But I found the returned value of lap.log_marginal_likelihood is not differentiable w.r.t. parameters other than the prior precision, that is, the temperature parameter cannot be optimized. It would be appreciated if you instruct me on how to do this.

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.