| --- |
| frameworks: |
| - pytorch |
| language: |
| - en |
| license: gpl-3.0 |
| tags: |
| - OneScience |
| - KNO |
| - Koopman-operator |
| - neural-operator |
| - computational-fluid-dynamics |
| - Navier-Stokes |
| tasks: |
| - time-series-prediction |
| --- |
| <p align="center"> |
| <strong> |
| <span style="font-size: 30px;">KNO</span> |
| </strong> |
| </p> |
| |
| # Model Overview |
|
|
| KNO (Koopman Neural Operator) is a neural operator based on Koopman operator theory for learning the evolution of nonlinear dynamical systems. This model predicts Navier–Stokes time series on a two-dimensional regular grid, using the first 10 time steps to predict the subsequent 10 by default. |
|
|
| Paper: Koopman Neural Operator as a Mesh-free Solver of Non-linear Partial Differential Equations |
| https://doi.org/10.1016/j.jcp.2024.113194 |
|
|
| # Model Description |
|
|
| KNO uses an encoder to map historical physical fields into a latent Koopman space, learns an approximately linear evolution operator in the Fourier domain, and reconstructs future physical fields with a decoder. The model supports either linear or nonlinear latent-state propagation and performs multistep flow prediction autoregressively. |
|
|
| # Use Cases |
|
|
| | Use Case | Description | |
| | :---: | :--- | |
| | Flow-field time-series prediction | Predict future Navier–Stokes states from historical vorticity fields | |
| | Koopman operator research | Study approximately linear evolution of nonlinear dynamical systems in latent space | |
| | CFD surrogate modeling | Learn mappings from historical to future physical fields on regular grids | |
| | Pipeline validation | Validate training and inference using the bundled weights or a small-scale configuration | |
|
|
| # Usage |
|
|
| ## 1. OneCode |
|
|
| Use the online OneCode environment for an intelligent, one-click AI for Science (AI4S) programming experience: |
|
|
| [Launch OneCode for one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home) |
|
|
| ## 2. Manual Setup |
|
|
| **Hardware Requirements** |
|
|
| - A GPU or DCU is recommended for training and inference. |
| - A CPU can be used for small-scale pipeline validation, but full training will be slow. |
| - DCU users must install DTK and a PyTorch environment compatible with the target cluster. |
|
|
| ### Download the Model Package |
|
|
| ```bash |
| modelscope download --model OneScience/KNO --local_dir ./KNO |
| cd KNO |
| ``` |
|
|
| ### Set Up the Runtime Environment |
|
|
| **DCU Environment** |
|
|
| ```bash |
| # Activate DTK and Conda first |
| conda create -n onescience311 python=3.11 -y |
| conda activate onescience311 |
| pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai |
| ``` |
|
|
| **GPU Environment** |
|
|
| ```bash |
| # Activate Conda first |
| conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12 |
| conda activate onescience311 |
| pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai |
| ``` |
|
|
| ### Training Data |
|
|
| The model uses the standard Navier–Stokes dataset `NavierStokes_V1e-5_N1200_T20.mat`, in which the data variable `u` has shape `[1200, 64, 64, 20]`. Download the data with the following command and verify that the data path in `conf/config.yaml` is configured correctly: |
|
|
| ```bash |
| modelscope download --dataset OneScience/cfd_benchmark data/ns/NavierStokes_V1e-5_N1200_T20.mat --local_dir ./data |
| ``` |
|
|
| ### Training |
|
|
| ```bash |
| python scripts/train.py |
| ``` |
|
|
| The default weights are saved to `weight/kno_navier_stokes.pt`. |
|
|
| ### Model Weights |
|
|
| This repository provides weights trained on the standard Navier–Stokes dataset in the `weight/` directory. |
|
|
| ### Inference, Evaluation, and Visualization |
|
|
| The model package includes weights for pipeline validation. After preparing the data, run: |
|
|
| ```bash |
| python scripts/inference.py |
| ``` |
|
|
| The script loads `weight/kno_navier_stokes.pt` by default. Predicted tensors and visualizations are saved to the `result/` directory. Training and inference parameters can be modified in `conf/config.yaml`. |
|
|
| # Official OneScience Resources |
|
|
| | Platform | OneScience Repository | Skills Repository | |
| | --- | --- | --- | |
| | Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills | |
| | GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills | |
|
|
| # Citations and License |
|
|
| - Xiong, W. et al. Koopman Neural Operator as a Mesh-free Solver of Non-linear Partial Differential Equations. Journal of Computational Physics, 2024. |
| - Xiong, W. et al. KoopmanLab: Machine Learning for Solving Complex Physics Equations. APL Machine Learning, 2023. |
| - The model implementation is derived from KoopmanLab under the GPL-3.0 license. This model package retains the GPL-3.0 license and the corresponding source attribution. |
|
|