simulation.utils.machine_learning.models.resnet_generator module

Summary

Classes:

ResnetGenerator

Resnet-based generator that consists of Resnet blocks between a few downsampling/upsampling operations.

Reference

class ResnetGenerator(input_nc: int, output_nc: int, ngf: int = 64, norm_layer: Type[torch.nn.modules.module.Module] = <class 'torch.nn.modules.batchnorm.BatchNorm2d'>, use_dropout: bool = False, n_blocks: int = 6, padding_type: str = 'reflect', activation: torch.nn.modules.module.Module = Tanh(), conv_layers_in_block: int = 2, dilations: Optional[List[int]] = None)[source]

Bases: torch.nn.modules.module.Module, simulation.utils.basics.init_options.InitOptions

Resnet-based generator that consists of Resnet blocks between a few downsampling/upsampling operations.

We adapt Torch code and idea from Justin Johnson’s neural style transfer project( https://github.com/jcjohnson/fast-neural-style)

forward(input: torch.Tensor) → torch.Tensor[source]

Standard forward.

Parameters

input – The input tensor

training: bool