Skip to content

Multi-layer recurrent neural networks for training and sampling from texts

Notifications You must be signed in to change notification settings

klaxxon/RNN-for-text

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

char-rnn-keras

Simply added test output every epoch as the model trains. You can change the number of characters on lines 131 of train.py. After training, you can resume with --resume. It will stop after 100, so you can use the sample.py script to view output.

Multi-layer recurrent neural networks for training and sampling from texts, inspired by Andrej Karpathy's article and the original torch source code karpathy/char-rnn.

Requirements

This code is written in Python 3, and it requires the Keras deep learning library.

Input data

All input data should be placed in the data/ directory. Sample training texts are provided.

Usage

To train the model with default settings:

$ python train.py --input tiny-shakespeare.txt

To sample the model at epoch 100:

$ python sample.py 100

Training loss/accuracy is stored in logs/training_log.csv. Model results, including intermediate model weights during training, are stored in the model directory. These are also used by sample.py for sampling.

About

Multi-layer recurrent neural networks for training and sampling from texts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%