karpathy's char-rnn (https://github.com/karpathy/char-rnn) implementation by Chainer
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data/tinyshakespeare
CharRNN.py
LICENSE Initial commit Jun 30, 2015
README.md Update README.md Jan 11, 2016
sample.py fix UnicodeDecodeError Jan 17, 2016
train.py overwrite latest checkpoint file to 'latest.chainermodel' Jan 17, 2016

README.md

chainer-char-rnn

karpathy's char-rnn implementation by Chainer

Requirement

$ pip install chainer

Train

Start training the model using train.py, for example

$ python train.py

The --data_dir flag specifies the dataset to use. By default it is set to data/tinyshakespeare which consists of a subset of works of Shakespeare.

Your own data: If you'd like to use your own data create a single file input.txt and place it into a folder in data/. For example, data/some_folder/input.txt.

Sampling

Given a checkpoint file (such as those written to cv) we can generate new text. For example:

$ python sample.py \
--vocabulary data/tinyshakespeare/vocab.bin \
--model cv/some_checkpoint.chainermodel \
--primetext some_text --gpu -1

References