mindearth.cell.DgmrDiscriminator

View Source On Gitee
class mindearth.cell.DgmrDiscriminator(in_channels=1, num_spatial_frames=8, conv_type='standard')[source]

The Dgmr Discriminator is based on Temporal Discriminator and Spatial Discriminator, which contains deep residual block. The details can be found in Skilful precipitation nowcasting using deep generative models of radar.

Parameters
  • in_channels (int) – The channels of input frame.

  • num_spatial_frames (int) – 8 Random frames out of lead times.

  • conv_type (str) – convolutional layer's type.

Inputs:
  • x (Tensor) - Tensor of shape \((2, frames\_size, channels, height\_size, width\_size)\).

Outputs:

Tensor, the output of the DgmrDiscriminator.

  • output (Tensor) - Tensor of shape \((2, 2, 1)\).

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> import mindspore as ms
>>> from mindspore import ops, Tensor
>>> from mindspore.nn import Cell
>>> from mindearth.cell.dgmr.dgmrnet import DgmrDiscriminator
>>> real_and_generator = np.random.rand(2, 22, 1, 256, 256).astype(np.float32)
>>> net = DgmrDiscriminator(in_channels=1, num_spatial_frames=8, con_type="standard")
>>> out = net(Tensor(real_and_generator, ms.float32))
>>> print(out.shape)
(2, 2, 1)