Imported from https://github.com/rxian/gan_tensorflow