Imported from https://github.com/IBM/BAGAN