Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if opts['dataset'] in ('gmm', 'circle_gmm'):
if opts['unrolled'] is True:
gan_class = GAN.ToyUnrolledGan
else:
gan_class = GAN.ToyGan
elif opts['dataset'] in pic_datasets:
if opts['unrolled']:
gan_class = GAN.ImageUnrolledGan
# gan_class = GAN.ToyUnrolledGan
else:
if 'vae' in opts and opts['vae']:
gan_class = VAE.ImageVae
assert opts['latent_space_distr'] == 'normal',\
'VAE works only with Gaussian prior'
elif 'pot' in opts and opts['pot']:
gan_class = POT.ImagePot
else:
gan_class = GAN.ImageGan
if opts['dataset'] in supervised_pic_datasets\
and 'conditional' in opts and opts['conditional']:
gan_class = GAN.MNISTLabelGan
elif opts['dataset'] == 'guitars':
if opts['unrolled']:
gan_class = GAN.ImageUnrolledGan
else:
gan_class = GAN.BigImageGan
else:
assert False, "We don't have any other GAN implementations yet..."
self._gan_class = gan_class
if opts["inverse_metric"]:
inv_num = opts['inverse_num']
assert inv_num < data.num_points, \