This is a TensorFlow re-implementation of the char-rnn Lua code by Karpathy.
See Karpathy blog for description of what all this is about.
You will need:
- A text file with some data (you can use
tinyshakespeare.txtfrom thedata/folder) - A machine with installed Python 3
- (optional but highly recommended) a GPU on this
Configure and use virtual environment, install required packages:
virtualenv .venv -p python3
. .venv/bin/activate
pip install -r requirements.txt
pip install tensorflow # or tensorflow-gpu, if you have GPU
python train.py --input_data data/tinyshakespeare.txt --train_dir tinyshakespeare
Start TensorBoard server
python -m tensorflow.tensorboard.tensorboard --logdir `pwd`
Use web browser to connect to the TensorBoard server and see computational graph and plots of training and validation losses.
python sample.py --load_model tinyshakespeare/lm_10000.model --prefix 'O thy!'