ankitshah009 / adaptive-softmax-pytorch

Adaptive Softmax implementation for PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adaptive Softmax for PyTorch

This is a translation from https://github.com/facebookresearch/adaptive-softmax, described in the paper "Efficient softmax approximation for GPUs" (http://arxiv.org/abs/1609.04309).

You can first download and preprocess text8 dataset by:

python download_text8.py

then train language model with adaptive softmax:

python text8.py

or you can train with regular softmax:

python text8.py --model=linear

I got similar perplexity to regular softmax with adaptive softmax with about 3x speed up. adaptive softmax itself is about 5.6x faster than regular softmax.

About

Adaptive Softmax implementation for PyTorch

License:MIT License


Languages

Language:Python 100.0%