factory module#

factory.parse_list(str_list: str, type_: type) list[source]#
class factory.IGANFactory(parser: ConfigParser)[source]#

Bases: ABC

Factory that represents a GAN. This factory does not keep of created references.

__init__(parser: ConfigParser) None[source]#

Initialize the factory.

Parameters:

parser (ConfigParser) – Parser for config file containing GAN model and training params.

abstract get_gan() GAN[source]#

Returns a GAN instance

Returns:

GAN instance.

Return type:

GAN

abstract get_trainer() Callable[source]#

Returns the GAN train function.

Returns:

GAN train() function.

Return type:

Callable

_abc_impl = <_abc._abc_data object>#
class factory.GANFactory(parser: ConfigParser)[source]#

Bases: IGANFactory

get_gan() GAN[source]#

Returns a GAN instance

Returns:

GAN instance.

Return type:

GAN

get_trainer() Callable[source]#

Returns the GAN train function.

Returns:

GAN train() function.

Return type:

Callable

_abc_impl = <_abc._abc_data object>#
class factory.ConditionalCatGANFactory(parser: ConfigParser)[source]#

Bases: IGANFactory

get_gan() ConditionalCatGAN[source]#

Returns a GAN instance

Returns:

GAN instance.

Return type:

GAN

get_trainer() Callable[source]#

Returns the GAN train function.

Returns:

GAN train() function.

Return type:

Callable

_abc_impl = <_abc._abc_data object>#
class factory.ConditionalProjGANFactory(parser: ConfigParser)[source]#

Bases: IGANFactory

get_gan() ConditionalProjGAN[source]#

Returns a GAN instance

Returns:

GAN instance.

Return type:

GAN

get_trainer() Callable[source]#

Returns the GAN train function.

Returns:

GAN train() function.

Return type:

Callable

_abc_impl = <_abc._abc_data object>#
class factory.CausalGANFactory(parser: ConfigParser)[source]#

Bases: IGANFactory

get_cc() GAN[source]#
get_gan() CausalGAN[source]#

Returns a GAN instance

Returns:

GAN instance.

Return type:

GAN

get_trainer() Callable[source]#

Returns the GAN train function.

Returns:

GAN train() function.

Return type:

Callable

_abc_impl = <_abc._abc_data object>#
factory.get_factory(cfg: ConfigParser) IGANFactory[source]#

Return the factory for the GAN type based on ‘model’ key in the parser.

Parameters:

cfg (ConfigParser) – Parser for config file containing GAN model and training params.

Returns:

Factory for the specified GAN.

Return type:

IGANFactory

Raises:

ValueError – If the model is unknown or not implemented.