Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindflow.cell.FNO1D

class mindflow.cell.FNO1D(in_channels, out_channels, resolution, modes, channels=20, depths=4, mlp_ratio=4, compute_dtype=mstype.float32)[source]

The 1-dimensional Fourier Neural Operator (FNO1D) contains a lifting layer, multiple Fourier layers and a decoder layer. The details can be found in Fourier neural operator for parametric partial differential equations.

Parameters
  • in_channels (int) – The number of channels in the input space.

  • out_channels (int) – The number of channels in the output space.

  • resolution (int) – The spatial resolution of the input.

  • modes (int) – The number of low-frequency components to keep.

  • channels (int) – The number of channels after dimension lifting of the input. Default: 20.

  • depths (int) – The number of FNO layers. Default: 4.

  • mlp_ratio (int) – The number of channels lifting ratio of the decoder layer. Default: 4.

  • compute_dtype (dtype.Number) – The computation type of dense. Default: mindspore.common.dtype.float32. Should be mindspore.common.dtype.float32 or mindspore.common.dtype.float16. float32 is recommended for the GPU backend, float16 is recommended for the Ascend backend.

Inputs:
  • x (Tensor) - Tensor of shape (batch_size,resolution,in_channels).

Outputs:

Tensor, the output of this FNO network.

  • output (Tensor) -Tensor of shape (batch_size,resolution,out_channels).

Raises
Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> from mindspore.common.initializer import initializer, Normal
>>> from mindflow.cell.neural_operators import FNO1D
>>> B, W, C = 32,1024,1
>>> input_ = initializer(Normal(), [B, W, C])
>>> net = FNO1D(in_channels=1, out_channels=1, resolution=64, modes=12)
>>> output = net(input_)
>>> print(output.shape)
(32, 1024, 1)