A PyTorch attempt at reimplementing
- MaskGAN: Better Text Generation via Filling in the _______ , William Fedus, Ian Goodfellow, Andrew M. Dai [paper]
This is a work in progress.
I used google/SentencePiece to bring down the vocabulary to make training easier. The trained models are available inside this repository. Install the python bindings through pip so the code can use it.
python3 -m pip install sentencepiece
This code is build using the basic blocks provided by pytorch/fairseq. Please follow instructions there to install fairseq as a library.
python3 -m pip install git+https://github.com/pytorch/fairseq
mkdir datasets
cd datasets
IMDB_DATASET='http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz'
wget $IMDB_DATASET -O aclImdb_v1.tar.gz
tar xvzf aclImdb_v1.tar.gz
Launch a visdom instance for logging.
python3 -m pip install visdom # Install if not present.
python3 -m visdom.server &
Run the training script.
python3 -m mgan.main \
--path datasets/aclImdb/train/ \
--spm_path datasets/aclImdb/train/imdb.model