generators

Generator module.

class mfai.pytorch.models.gan_dgmr.generators.Generator(conditioning_stack, latent_stack, sampler)[source]

Bases: Module

Generator class.

Parameters:
forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses. :rtype: Tensor

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.

Parameters:

x (Tensor)

Return type:

Tensor

class mfai.pytorch.models.gan_dgmr.generators.Sampler(forecast_steps=18, latent_channels=768, context_channels=384, output_channels=1)[source]

Bases: Module

Sampler class.

Parameters:
  • forecast_steps (int)

  • latent_channels (int)

  • context_channels (int)

  • output_channels (int)

forward(conditioning_states, latent_dim)[source]

Perform the sampling from Skillful Nowcasting with GANs.

Parameters:
  • conditioning_states (list[Tensor]) – Outputs from the ContextConditioningStack with the 4 input

  • states – Output from

  • latent_dim (Tensor) – Output from

  • ConvGRUs (LatentConditioningStack for input into the)

  • latent_dim – (Tensor)

Return type:

Tensor

Returns:

forecast_steps-length output of images for future timesteps