mindflow.cell.SNO2D

View Source On Gitee
class mindflow.cell.SNO2D(in_channels, out_channels, hidden_channels=64, num_sno_layers=3, data_format='channels_first', transforms=None, kernel_size=5, num_usno_layers=0, num_unet_strides=1, activation='gelu', compute_dtype=mstype.float32)[source]

The 2D SNO, which contains a lifting layer (encoder), multiple spectral transform layers and a projection layer (decoder). See documentation for base class, mindflow.cell.SNO.

Examples

>>> import numpy as np
>>> from mindspore import Tensor
>>> import mindspore.common.dtype as mstype
>>> from mindflow.cell import SNO2D
>>> resolution, modes = 100, 12
>>> matr = Tensor(np.random.rand(modes, resolution), mstype.float32)
>>> inv_matr = Tensor(np.random.rand(resolution, modes), mstype.float32)
>>> net = SNO2D(in_channels=2, out_channels=5, transforms=[[matr, inv_matr]] * 2,
>>>             num_usno_layers=2, num_unet_strides=2)
>>> x = Tensor(np.random.rand(19, 2, resolution, resolution), mstype.float32)
>>> y = net(x)
>>> print(x.shape, y.shape)
(19, 2, 100, 100) (19, 5, 100, 100)