Interfaces¶
A collection of fully-specified model interfaces.
-
class
ttools.interfaces.GANInterface(gen, discrim, lr=0.0001, ncritic=1, opt='rmsprop', cuda=<sphinx.ext.autodoc.importer._MockObject object>, gan_weight=1.0, max_grad_norm=None)[source]¶ Abstract GAN interface.
Parameters: - gen (th.nn.Module) – generator.
- discrim (th.nn.Module) – discriminator.
- lr (float) – learning rate for both discriminator and generator.
- ncritic (int) – number of discriminator updates per generator update.
- opt (str) – optimizer type for both discriminator and generator.
- cuda (bool) – whether or not to use CUDA.
- max_grad_norm (None or scalar) – clip gradients above that threshold if provided.
-
class
ttools.interfaces.LSGANInterface(*args, **kwargs)[source]¶ Least-squares GAN interface [Mao2017].
-
class
ttools.interfaces.RGANInterface(*args, **kwargs)[source]¶ Relativistic GAN interface [Jolicoeur-Martineau2018].
-
class
ttools.interfaces.RaGANInterface(*args, **kwargs)[source]¶ Relativistic average GAN interface [Jolicoeur-Martineau2018].
-
class
ttools.interfaces.RaLSGANInterface(*args, **kwargs)[source]¶ Relativistic average Least-squares GAN interface [Jolicoeur-Martineau2018].