ONO
Model Overview
ONO (Orthogonal Neural Operator) is a neural operator that incorporates orthogonal attention to learn the evolution of complex physical 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: Improved Operator Learning by Orthogonal Attention
https://arxiv.org/abs/2310.12487
Model Description
ONO uses attention to capture global relationships among grid points and updates physical-field features through covariance whitening and orthogonal projection, mitigating feature degradation and oversmoothing in deep neural operators. The model supports Nyström, linear, and standard self-attention 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 |
| CFD surrogate modeling | Learn mappings from historical to future physical fields on regular grids |
| Pipeline validation | Validate model training, inference, and result visualization with 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
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
hf download OneScience-Group/ONO --local-dir ./ONO
cd ONO
Set Up the Runtime Environment
DCU Environment
# 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
# 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:
hf download --repo-type dataset OneScience-Group/cfd_benchmark data/ns/NavierStokes_V1e-5_N1200_T20.mat --local-dir ./data
Training
python scripts/train.py
The default weights are saved to weight/ono_navier_stokes.pt.
Model Weights
This repository provides weights trained on the standard Navier–Stokes dataset in the weight/ directory.
Inference, Evaluation, and Visualization
python scripts/inference.py
The script loads weight/ono_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
- Improved Operator Learning by Orthogonal Attention. ICML, 2024.
- This model package is released under the Apache-2.0 license and retains attribution to the original paper and data sources.
中文说明
模型概览
ONO 是一种正交神经算子(Orthogonal Neural Operator),结合正交注意力学习复杂物理系统的演变。模型在二维规则网格上预测 Navier–Stokes 时间序列,默认用前 10 个时间步预测后续 10 个时间步。
论文:利用正交注意力改进算子学习
https://arxiv.org/abs/2310.12487
模型描述
ONO 使用注意力捕获网格点之间的全局关系,通过协方差白化和正交投影更新物理场特征,以缓解深层神经算子中的特征退化和过度平滑。模型支持 Nyström、线性和标准自注意力,并自回归执行多步流场预测。
使用场景
| 使用场景 | 说明 |
|---|---|
| 流场时间序列预测 | 根据历史涡度场预测未来的 Navier–Stokes 状态 |
| 计算流体力学(CFD)代理建模 | 在规则网格上学习从历史物理场到未来物理场的映射 |
| 流程验证 | 通过小规模配置验证模型训练、推理(inference)和结果可视化 |
使用指南
1. OneCode
通过 OneCode 在线环境体验面向科学的人工智能(AI4S)智能一键编程。
2. 手动配置
硬件要求
- 训练和推理建议使用 GPU 或 DCU。
- 可使用 CPU 进行小规模流程验证,完整训练速度较慢。
- DCU 用户须安装 DTK 以及与目标集群兼容的 PyTorch 环境。
下载模型包
hf download OneScience-Group/ONO --local-dir ./ONO
cd ONO
配置运行环境
DCU 环境
# 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 环境
# 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
训练数据
模型使用标准 Navier–Stokes 数据集 NavierStokes_V1e-5_N1200_T20.mat,其中数据变量 u 的形状为 [1200, 64, 64, 20]。使用以下命令下载数据,并确认 conf/config.yaml 中的数据路径配置正确。
hf download --repo-type dataset OneScience-Group/cfd_benchmark data/ns/NavierStokes_V1e-5_N1200_T20.mat --local-dir ./data
训练
python scripts/train.py
默认权重保存到 weight/ono_navier_stokes.pt。
模型权重
本仓库在 weight/ 目录中提供使用标准 Navier–Stokes 数据集训练得到的权重。
推理、评估与可视化
python scripts/inference.py
脚本默认加载 weight/ono_navier_stokes.pt。预测张量及可视化结果保存到 result/ 目录,可在 conf/config.yaml 中修改训练和推理参数。
OneScience 官方资源
| 平台 | OneScience 仓库 | Skills 仓库 |
|---|---|---|
| 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 |
引用与许可证
- Improved Operator Learning by Orthogonal Attention. ICML, 2024.
- 本模型包采用 Apache-2.0 许可证发布,并保留原始论文和数据来源的署名。
- Downloads last month
- 23