Skip to content

vyraun/handwriting

 
 

Repository files navigation

Conditional handwriting generation

img

Reproduces Alex Graves paper Generating Sequences With Recurrent Neural Networks.
Thanks to Jose Sotelo and Kyle Kastner for helpful discussions.

Requirements

  • Theano
  • Lasagne (just for the Adam optimizer)
  • Raccoon: version 98b42b21e6df0ce09eaa7b9ad2dd10fcc993dd85

Generate the data

Download the following files and unpack them in a directory named 'handwriting':

Add an environment variable $DATA_PATH containing the parent directory of 'handwriting'.

Train the model

Set an environment variable $TMP_PATH to a folder where the intermediate results, parameters, plots will be saved during training.

If you want to change the training configuration, modify the beginning of main_cond.py. Run main_cond.py. By default, it is a one-layer GRU network with 400 hidden units.
There is no ending condition, so you will have to stop training by doing ctrl+c.

It takes a few hours to train the model on a high-end GPU.

Generate sequences

Run python sample_model.py -f $TMP_PATH/handwriting/EXP_ID/f_sampling.pkl -s 'Sous le pont Mirabeau coule la Seine.' -b 0.7 -n 2 where EXP_ID is the generated id of the experiment you launched.

img

About

Conditional handwriting generation in Theano

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%