mindflow.cell.PDENet

class mindflow.cell.PDENet(height, width, channels, kernel_size, max_order, dx=0.01, dy=0.01, dt=0.01, periodic=True, enable_moment=True, if_fronzen=False)[source]

The PDE-Net model.

PDE-Net is a feed-forward deep network to fulfill two objectives at the same time: to accurately predict dynamics of complex systems and to uncover the underlying hidden PDE models. The basic idea is to learn differential operators by learning convolution kernels (filters), and apply neural networks or other machine learning methods to approximate the unknown nonlinear responses. A special feature of the proposed PDE-Net is that all filters are properly constrained, which enables us to easily identify the governing PDE models while still maintaining the expressive and predictive power of the network. These constrains are carefully designed by fully exploiting the relation between the orders of differential operators and the orders of sum rules of filters (an important concept originated from wavelet theory).

For more details, please refers to the paper PDE-Net: Learning PDEs from Data.

Parameters
  • height (int) – The height number of the input and output tensor of the PDE-Net.

  • width (int) – The width number of the input and output tensor of the PDE-Net.

  • channels (int) – The channel number of the input and output tensor of the PDE-Net.

  • kernel_size (int) – Specifies the height and width of the 2D convolution kernel.

  • max_order (int) – The max order of the PDE models.

  • dx (float) – The spatial resolution of x dimension. Default: 0.01.

  • dy (float) – The spatial resolution of y dimension. Default: 0.01.

  • dt (float) – The time step of the PDE-Net. Default: 0.01.

  • periodic (bool) – Specifies whether periodic pad is used with convolution kernels. Default: True.

  • enable_moment (bool) – Specifies whether the convolution kernels are constrained by moments. Default: True.

  • if_fronzen (bool) – Specifies whether the moment is frozen. Default: False.

Inputs:
  • input (Tensor) - Tensor of shape \((batch\_size, channels, height, width)\).

Outputs:

Tensor, has the same shape as input with data type of float32.

Raises
  • TypeError – If height, width, channels, kernel_size or max_order is not an int.

  • TypeError – If periodic, enable_moment, if_fronzen is not a bool.

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> from mindspore import Tensor
>>> import mindspore.common.dtype as mstype
>>> from mindflow.cell.neural_operators import PDENet
>>> input = Tensor(np.random.rand(1, 2, 16, 16), mstype.float32)
>>> net = PDENet(16, 16, 2, 5, 3, 2)
>>> output = net(input)
>>> print(output.shape)
(1, 2, 16, 16)