Giter VIP home page Giter VIP logo

vitutorial's Introduction

Binder

This repository stores material for a tutorial on variational inference for NLP audiences.

Want to host our tutorial at your location? Contact one of us!

Useful links

Neural networks are taking NLP by storm. Yet they are mostly applied to fully supervised tasks. Many real-world NLP problems require unsupervised or semi-supervised models, however, because annotated data is hard to obtain. This is where generative models shine. Through the use of latent variables they can be applied in missing data settings. Furthermore they can complete missing entries in partially annotated data sets.

This tutorial is about how to use neural networks inside generative models, thus giving us Deep Generative Models (DGMs). The training method of choice for these models is variational inference (VI). We start out by introducing VI on a basic level. From there we turn to DGMs. We justify them theoretically and give concrete advise on how to implement them. For continuous latent variables, we review the variational autoencoder and use Gaussian reparametrisation to show how to sample latent values from it. We then turn to discrete latent variables for which no reparametrisation exists. Instead, we explain how to use the score-function or REINFORCE gradient estimator in those cases. We finish by explaining how to combine continuous and discrete variables in semi-supervised modelling problems.

  • A new module on normalising flows has been added. Normalising flows are a way of learning distributions. Check it out to learn more. Soon we will also add module on ADVI, a black-box variational inference procedure.
  • We have now tagged the version of the tutorial that we presented at ACL 2018 in Melbourne to simplify future reference. To get to that version, click here.
  • We have added a module on discrete latent variables. This also led to a change in the module structure. The DGM part (M3) now consists of 2 interdependent modules. One presents continuous latent variable models and the other discrete latent variable models.
  • The tutorial code is now available! The user still needs to complete the TODOs in order for the code to run. Make sure to follow the instructions and read the comments carefully. Also check out the links to the MXNet documention.

Upcoming

Below are confirmed venues and dates (if available) for future presentations of the tutorial. Please contact us if you interested in hosting the tutorial.

Past

  • University of Heidelberg: Nov 29/30 2018
    1. Thursday, Nov 29: Basics of VI, continuous and discrete Deep Generative Models
    2. Friday, Nov 30: Automatic differentiation VI, normalising flows
  • ACL 2018, Melbourne: July 15th, 2018
  • Naver Labs, Grenoble, France: April 3 and April 6, 2018
    1. Deep Generative Models
  • Uva-ILLC, Amsterdam: March 22, 2018
  • Macquarie University Sydney: March 19-20, 2018
    1. Basics of Variational Inference
    2. Deep Generative Models
    3. Coding Tutorial
  • Monash University
    1. Basics of Variational Inference: Thu, 16-11-217, 10am-11:30am
    2. Deep Generative Models: Thu, 16-11-2017, 2:30pm-4pm
  • Melbourne University
    1. Basics of Variational Inference: Tue, 31-10-2017, Doug McDonell Building, room 8.03, 2:00pm-3:15pm
    2. Deep Generative Models: Thu, 02-11-2017, Doug McDonell Building, room 8.03, 2:15pm-3:30pm
    3. Coding Tutorial: Tue, 07-11-2017, Doug McDonell Building, room 8.03, 2:00pm-3:15pm
  • Berlin, July 26-27 2017

Latex Dependencies

To compile the slides, latex needs to have access to the bayesnet tikz library.

While we strive to update our code base with new and more complex models, the Gaussian VAE is at the heart of the tutorial. See here for what the computation graph of such a model looks like. (No worries, it's actually pretty straightforward to implement.)

Dependencies

Framework: Our code uses MXNet which is a scalable machine learning library that is under active development. For more details on how to install MXNet see here.

To run the tutorial code and notebook, we recommend that you setup a virtual environment. Your Python version should be 3.5 or higher.

Warning: If you are using linux and Python3.6 or higher you need to run sudo apt-get install libssl-dev before building Python. Otherwise, there is a chance that your virtualenv will not be able to download packages.

virtualenv -p python3 vi-tutorial-env
source vi-tutorial-env/bin/activate
pip install mxnet # cpu installation
pip install mxnet-cu80 # gpu installation with cuda 8
pip install jupyter matplotlib

Issues with matplotlib: If you are using linux and building python from source, pyplot might not work for you because it's missing tkinter (_tkinter module). In that case run sudo apt-get install tk-dev and rebuild python.

Usage

Once you have executed the above commands, open a notebook with jupyter notebook. Then use your browser to navigate to the notebook. The notebook file is: <path to repo>/VITutorial/code/vae_notebook.ipynb. Make sure to have activated the vi-tutorial-env environment before starting the notebook.

Want to host our tutorial? Have a suggestion? Contact one of us!

vitutorial's People

Contributors

martijnvanbeers avatar philschulz avatar wilkeraziz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vitutorial's Issues

M0

Thanks for doing this. It's looking really good! Easing people into the topic is definitely a good idea. Please create a PR next time. I will now refer to slide numbers. (There seems to be problem with the slide numbers btw. -> the total is always 1).

slide 3: I don't agree with you definition of unsupervised learning. Learning a distribution over data sounds exactly like supervised learning to me. Shouldn't it be "learn a joint distribution over observed and unobserved data?" Also the examples are not entirely clear to me. You can learn sentences, images etc. fully supervised and conversely you can do unsupervised parsing.

slide 4: I would put another pause before the second itemize

slide 5: good one!

slide 9: too much. Split this slide up in two.

slide 10: I'm struggling with the last bullet point. In what respect is stochastic optimisation more general purpose than backprop?

slide 15: Really nice way of kicking off the tutorial!

Missing bayesnet

This line does not compile

\usetikzlibrary{bayesnet}

Possible actions

  • Add tikzlibrarybayesnet.code.tex to VITutorial/modules and load it with a relative path
\input{../tikzlibrarybayesnet.code.tex}
  • Add information to the README explaining how to install tikz bayesnet

Check if you like the abstract

We probably need to make it a bit nicer visually. Also, feel free to add anything that you feel is missing. It's in the proposal branch.

Beamer style

We have to decide on a beamer layout before we start working on the slides. Have a look here. I would vote for either Boadilla with beaver or Montpellier with beaver.

Proposal for ACL

I have started working on the proposal for the tutorial. It is only an first version and still far from perfect. Feel free to edit and directly push on the proposal branch. The description definitely still needs to grow a a bit as it should be close to 2 pages. Please also double check the timetable and let me know if you disagree with any of the topics or their order.

How to assign People

This is an example issue that is opened to demonstrate assignment of issues and reviews. To the right their is a toolbar where one can select Assignees (people who should resolve the issue). When post pull request in the same toolbar there is the additional option of assigning reviewers.

The main reason to open issues is to
a) suggest improvements that cannot be implemented immediately but should be implemented
in the future
b) address decisions/questions about the project that cannot be covered in pull request (i.e. that are not directly related to tex or code).

Table of contents

For M6 I just tried having a table of contents at the beginning and showing it again with the current section highlighted at the beginning of each section. Personally, I am not a big fan of this but I think it may be crucial for people to recognize when we're switching gears (or to wake up again if they dropped out of a section). What do you think, should we add this to all modules? The relevant command is

\frame{\tableofcontents[currentsection]}

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.