Imported from https://github.com/neychev/adversarial_variational_optimization