Code Monkey home page Code Monkey logo

delta-rnn-theano's Introduction

Delta-RNN-Theano

Simple code to support the paper "Learning Simpler Language Models with the Differential State Framework". This code contains a set of linked Python scripts, built on top of Theano (Theano-0.8.0-py2.7, tested on Centos 7 - uses the additional Theano library "Fuel" for processing the text data), to train and run various neural language models, particularly:

  • Long Short Term Memory (LSTM)
  • Gated Recurrent Unit (GRU)
  • Elman Recurrent Network (RNN)
  • The newly proposed Delta-RNN (from this paper)

An example file, for training a Delta-RNN with 100 hidden cells/units, is provided. To create the needed dictionary/lexicon, you can simply run the Bash script "build_dict.sh" filling in the relevant variable names. Make sure your text corpus (no matter what split it is, assuming you have a training text file, validation text file, and a test-set text file) is line-by-line (i.e., one sentence per line) and that tokens (words, subwords, or characters) are separated by a unique/consistent delimiter (default assumption is empty space, or "\s+"). Make sure you add in any out-of-vocabulary (OOV) tokens that occur in your data (since this code-base assumes you have pre-processed your text to properly handle OOV cases). There is some additional code in the /src folder that contains a procText.py script you can appropriate for pre-pending and appending and tokens if need be.

If you use this code or the Delta-RNN (mathematical) model itself (or even better, extend it!), please consider citing:

@article{ororbia2017deltarnn,
    author = {Ororbia II, Alexander G. and Mikolov, Tomas and Reitter, David},
    title = {Learning Simpler Language Models with the Differential State Framework},
    journal = {Neural Computation},
    volume = {29},
    number = {12},
    pages = {3327-3352},
    year = {2017}
}

Note: This code has only been minimally cleaned and offers no guarantees for practical applications, we apologize in advance for any inconvenience this might cause. This code is primarily meant to used to train simple RNN-LMs (recurrent neural network language models) on basic text corpora as in the original paper (and the sample training file was used to test that the code successfully ran).

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.