ONO / README.md
OneScience's picture
Upload folder using huggingface_hub
2f983e6 verified
|
Raw
History Blame Contribute Delete
4.22 kB
metadata
frameworks:
  - pytorch
language:
  - en
license: apache-2.0
tags:
  - OneScience
  - ONO
  - neural-operator
  - computational-fluid-dynamics
  - Navier-Stokes
tasks:
  - time-series-prediction

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

modelscope download --model OneScience/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:

modelscope download --dataset OneScience/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

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.