mindflow.pde.UnsteadyFlowWithLoss
- class mindflow.pde.UnsteadyFlowWithLoss(model, t_in=1, t_out=1, loss_fn='mse', data_format='NTCHW')[source]
Base class of unsteady user-defined data-driven problems.
- Parameters
- Supported Platforms:
Ascend
GPU
Examples
>>> import numpy as np >>> from mindspore import Tensor >>> import mindspore >>> from mindflow.pde import UnsteadyFlowWithLoss >>> from mindflow.cell import FNO2D >>> from mindflow.loss import RelativeRMSELoss ... >>> model = FNO2D(in_channels=1, out_channels=1, resolution=64, modes=12) >>> problem = UnsteadyFlowWithLoss(model, loss_fn=RelativeRMSELoss(), data_format='NHWTC') >>> inputs = Tensor(np.random.randn(32, 64, 64, 1, 1), mindspore.float32) >>> label = Tensor(np.random.randn(32, 64, 64, 1, 1), mindspore.float32) >>> loss = problem.get_loss(inputs, label) >>> print(loss) 31.999998