Code Monkey home page Code Monkey logo

adaptivetransformer's Introduction

AdaptiveTransformer

Barebones transformer decoder with adaptive input and adaptive softmax.

The model is largely based on the pytorch language model example code. The transformer is trained on the wikitext-2 dataset by default.

python main.py --cuda --epochs 6 --adsmax   # Train with adaptive softmax
python main.py --cuda --epochs 6 --adinp    # Train with adaptive input
python main.py --cuda --epochs 6 --tied_weights # Train with adaptive input and softmax with tied weights

Wikitext-2 results for 6 training epochs

Model Total Train Time (s) Test Perplexity
Vanilla 211.3 195.85
Adaptive Softmax 122.4 203.71
Adaptive Softmax (Pytorch Impl) 118.4 206.71
Adaptive Input 248.1 218.91
Adaptive Input (FAIR Impl) 249.2 240.39
Both (Tied Weights) 150.9 215.99

Text8 results for 10 training epochs, 512 dimension hidden and embedding layer

Model Total Train Time (s) Test Perplexity
Vanilla 13230 215.34
Adaptive Softmax 5002 198.62
Adaptive Input 7013 240.42
Both (Tied Weights) 4901 254.3

adaptivetransformer's People

Contributors

salemohamedo avatar

Watchers

James Cloos avatar  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.