cyto_dl.nn.discriminators.n_layer_discriminator module#

class cyto_dl.nn.discriminators.n_layer_discriminator.NLayerDiscriminator(input_nc: int = 2, ndf: int = 64, n_layers: int = 3, dim: int = 3, norm_layer=<class 'torch.nn.modules.instancenorm.InstanceNorm3d'>, noise_annealer=None)[source]#

Bases: Module

Defines a PatchGAN discriminator.

Parameters:
  • input_nc (int=2) – Number of channels of input images. Generally, n_channels(input_im)+n_channels(model_output)

  • ndf (int=64) – Number of filters in the first conv_fn layer. Later layers are multiples of ndf.

  • n_layers (int=3) – Number of conv_fn layers in the discriminator

  • norm_layer=nn.InstanceNorm3d – normalization layer

  • noise_annealer=None – Noise annealer object

forward(im, x, requires_features=False)[source]#

Standard forward.