Hands-on Generative Adversarial Network (GAN)

GAN [arXiv:1406.2661] is one of the most promising generative models according to the interview with Geoffrey Hinton. An excellent tutorial is available from this high school kid’s blog. Also, Pytorch tutorials include Deep Convolution Generative Adversarial Network (DCGAN) as an example from here. The model contains a discriminative model and a generative model, which is best explained by Goodfellow’s analogy.

The generative model can be thought of as analogous to a team of counterfeiters, trying to produce fake currency and use it without detection, while the discriminative model is analogous to the police, trying to detect the counterfeit currency.

Read More »

A vanilla Tensorflow recurrent neural net

I was looking for good tutorials on tf.contrib.rnn.BasicRNNCell() and tf.contrib.rnn.BasicLSTMCell(). Old tutorials (even one year ago) are not useful as modules in tf.contrib change from time to time. (Right now I am using API 1.3 version.) Recent tutorials look unnecessarily complicated. Then I realized I actually have Aurélien Géron’s book at hand, worth every dollar paid. Here I offer an example as simple as possible, which served as my starting point of using RNN with tensorflow. (I used to train RNN nets with Torch7, which has both better documentations and community tutorials. Glad it is now ported into Python as well.)Read More »

Debugging Reinforcement Neural Network (Deep Q Net)

I am playing with openAI gym (, and I suppose we should use reinforcement learning to solve most of the env’s.) But I am stuck at solving [the MountainCar-v0][1] env, but I found some interesting ways to debug the problem. I have experimented with several deep Q net (DQN) implementations, and manually tuned a few hyperparameters. Based on my experience, I have found things that matter a lot and things not so much.Read More »