PyTorch implementation of DRAW: A Recurrent Neural Network For Image Generation on the task of generating Devanagari Characters.
Deep Recurrent Attentive Writer (DRAW) is a neural network architecture for image generation. DRAW networks combine a novel spatial attention mechanism that mimics the foveation of the human eye, with a sequential variational auto-encoding framework that allows for the iterative construction of complex images. The system substantially improves on the state of the art for generative models on MNIST, and, when trained on the Street View House Numbers dataset, it generates images that cannot be distinguished from real data with the naked eye.
Blog Post: http://kuldeepsinghsidhu.blogspot.com
Articles: https://kuldeepsinghsidhu.blogspot.com/2019/01/generating-devanagari-using-draw.html
With Attention | Without Attention |
---|---|
Download the data and place it in the data/ directory. Run train.py
to start training. To change the hyperparameters of the network, update the values in the param
dictionary in train.py
.
Loss Curve
To generate new images run generate.py
.
python3 evaluate.py -load_path /path/to/pth/checkpoint -num_output n
The checkpoint file for the model trained for 50 epochs is present in checkpoint/ directory.
Devanagari Training Data | Generated Devanagari After 50 Epochs |
---|---|
Devanagari Numbers Only Training Data | Generated Devanagari Numbers After 50 Epochs |
---|---|
- Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, Daan Wierstra. DRAW: A Recurrent Neural Network For Image Generation. [arxiv]
- ericjang/draw [repo]
- What is DRAW (Deep Recurrent Attentive Writer)? [blog]
The Devanagari Character dataset is available on kaggle. (Source)
Kuldeep Singh Sidhu
Github: github/singhsidhukuldeep
https://github.com/singhsidhukuldeep
Website: Kuldeep Singh Sidhu (Website)
http://kuldeepsinghsidhu.com
LinkedIn: Kuldeep Singh Sidhu (LinkedIn)
https://www.linkedin.com/in/singhsidhukuldeep/