• Stars
    star
    525
  • Rank 84,404 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TensorFlow Implementation of "DRAW: A Recurrent Neural Network For Image Generation"

draw

TensorFlow implementation of DRAW: A Recurrent Neural Network For Image Generation on the MNIST generation task.

With Attention Without Attention

Although open-source implementations of this paper already exist (see links below), this implementation focuses on simplicity and ease of understanding. I tried to make the code resemble the raw equations as closely as posible.

For a gentle walkthrough through the paper and implementation, see the writeup here: http://blog.evjang.com/2016/06/understanding-and-implementing.html.

Usage

python draw.py --data_dir=/tmp/draw downloads the binarized MNIST dataset to /tmp/draw/mnist and trains the DRAW model with attention enabled for both reading and writing. After training, output data is written to /tmp/draw/draw_data.npy

You can visualize the results by running the script python plot_data.py <prefix> <output_data>

For example,

python myattn /tmp/draw/draw_data.npy

To run training without attention, do:

python draw.py --working_dir=/tmp/draw --read_attn=False --write_attn=False

Restoring from Pre-trained Model

Instead of training from scratch, you can load pre-trained weights by uncommenting the following line in draw.py and editing the path to your checkpoint file as needed. Save electricity!

saver.restore(sess, "/tmp/draw/drawmodel.ckpt")

This git repository contains the following pre-trained in the data/ folder:

Filename Description
draw_data_attn.npy Training outputs for DRAW with attention
drawmodel_attn.ckpt Saved weights for DRAW with attention
draw_data_noattn.npy Training outputs for DRAW without attention
drawmodel_noattn.ckpt Saved weights for DRAW without attention

These were trained for 10000 iterations with minibatch size=100 on a GTX 970 GPU.

Useful Resources

More Repositories

1

tdb

Interactive, node-by-node debugging and visualization for TensorFlow
JavaScript
1,357
star
2

awesome-graphics

Curated list of computer graphics tutorials and resources
1,048
star
3

cryptocurrency_arbitrage

Automated Trading program that detects pairwise and triangular arbitrage opportunities on altcoin/bitcoin exchanges
Python
819
star
4

gumbel-softmax

categorical variational autoencoder using the Gumbel-Softmax estimator
Jupyter Notebook
425
star
5

normalizing-flows-tutorial

Tutorial on normalizing flows.
Jupyter Notebook
293
star
6

genadv_tutorial

TensorFlow tutorial on Generative Adversarial Models
Jupyter Notebook
255
star
7

maml-jax

Implementation of Model-Agnostic Meta-Learning (MAML) in Jax
Jupyter Notebook
188
star
8

svd3

Fast singular value decomposition, diagonalization, QR decomposition of 3x3 matrices.
Mathematica
148
star
9

nf-jax

Normalizing Flows in Jax
Jupyter Notebook
105
star
10

pt-jax

Path Tracing in JAX
Jupyter Notebook
69
star
11

e2c

TensorFlow impementation of: Embed to Control: A Locally Linear Latent Dynamics Model for Control from Raw Images
Python
65
star
12

RNN-dynamics

Code and report for APMA136 Final Project
MATLAB
19
star
13

pptx-export-notes

Exports plaintext speaker notes from Microsoft Powerpoint .pptx files
Python
19
star
14

variance_reduction

Implementation of Variance Reduction Techniques in Julia
Jupyter Notebook
11
star
15

graphjs

Mathematical Graph representation in JavaScript
CoffeeScript
6
star
16

pyN

Neuron(s)-based library in Python using numpy and Blender Game Engine.
Python
6
star
17

glsl-playground

Shadertoy-compatible fragment shader viewer.
C++
5
star
18

julia-NeuralNets

Spiking neural network simulator written in Julia.
Julia
5
star
19

NeuralNets

(Yet another) C++ Simulator for Neural Networks
C++
4
star
20

geneva

activation function inspired by the Geneva drive
Jupyter Notebook
4
star
21

Social-Docking

Metropolis Monte Carlo + General AMBER Force Field implemented in JavaScript
JavaScript
3
star
22

boxbot

C++ Framework for embodied cognition / robot simulation / reinforcement learning
C++
3
star
23

node-user-agents

Quick HTTP user agent headers for slightly-immoral-and-very-improper web scraping
JavaScript
3
star
24

chaos

Jupyter Notebook
3
star
25

Hanabi.jl

customizable game engine for Hanabi, written in Julia
Julia
3
star
26

adaptive-e2c

Capstone project (Brown University)
Python
2
star
27

discord_chatbot

text-based multiplayer discord game
Python
1
star
28

cpu-render

Dumb CPU renderer for debugging shadertoy shaders
C++
1
star
29

aibook

ALife book.
HTML
1
star
30

java-graph

A simple graph class + dijkstra's
Java
1
star
31

graphjs_viz

Adds support for drawing in the graphjs library
1
star
32

ericjang.github.io

HTML
1
star
33

google-scrubber

Command-Line Utility for Scraping Google Data
1
star
34

DockJS

Molecular Docking framework built on top of ChemJS
JavaScript
1
star