ml.models.gan

Defines the wrapper model for the generator and discriminator of a GAN.

class ml.models.gan.GenerativeAdversarialNetworkModelConfig(name: str = '???', generator: Any = '???', discriminator: Any = '???')[source]

Bases: BaseModelConfig

generator: Any = '???'
discriminator: Any = '???'
classmethod update(config: DictConfig) DictConfig[source]

Runs post-construction config update.

Parameters:

config – The config to update

classmethod resolve(config: GenerativeAdversarialNetworkModelConfig) None[source]

Runs post-construction config resolution.

Parameters:

config – The config to resolve

class ml.models.gan.GenerativeAdversarialNetworkModel(config: GenerativeAdversarialNetworkModelConfig)[source]

Bases: BaseModel[GenerativeAdversarialNetworkModelConfig], Generic[GeneratorT, DiscriminatorT]

requires_grads_(generator: bool, discriminator: bool) None[source]
forward(*_args: Any, **_kwargs: Any) Any[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.