FluxNet-ShallowWater-LAP
Model Introduction
FluxNet-ShallowWater-LAP reproduces the two-dimensional shallow-water FluxNet-LAP pushforward experiment in the FluxNet paper. It forecasts water depth and two momentum fields on a 64x64 grid.
Model Description
The model takes (h, mx, my) and predicts the next state. The configuration uses 64 channels, six residual blocks, 5x5 kernels, a 3x3 transport neighborhood and five-step pushforward training.
Use Cases
| Use case | Description |
|---|---|
| Shallow-water forecasting | Forecast depth and momentum on a regular grid |
| Simulation acceleration | Compare surrogate rollouts against numerical reference trajectories |
Usage
1. OneCode
2. Manual Setup
Hardware requirements
- Training and inference require a Slurm-allocated HIP/DCU compute node; there is no silent CPU fallback.
- The formal run used one DCU, eight CPU cores and 30 GB of host memory. GPU execution was not validated.
Download the Model
hf download OneScience-Group/FluxNet-ShallowWater-LAP --local-dir ./FluxNet-ShallowWater-LAP
cd FluxNet-ShallowWater-LAP
Install Dependencies
DCU environment
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
pip install numpy h5py PyYAML matplotlib
GPU environment
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
pip install numpy h5py PyYAML matplotlib
The GPU commands describe dependency installation only; the provided scripts were validated on Slurm HIP/DCU.
Training Data
The OneScience/FluxNet-ShallowWater dataset on ModelScope contains 50 training, 20 validation, 50 short-test and 50 long-test trajectories produced with the paper's official numerical generator. Each HDF5 trajectory contains h, mx, my and t. The dataset is not mirrored on Hugging Face. Download it into the model directory:
modelscope download --dataset OneScience/FluxNet-ShallowWater --local_dir ./data
Run commands from the package root. data.root in config/config.yaml defaults to ./data.
Training
On a Slurm-allocated DCU node:
python scripts/train.py
The full run trains for 300 epochs and writes weight/best_model.pth. Back up the included best_model.pth and last_model.pth before retraining if they must be preserved.
Trained Weights
The included checkpoint is the best validation-MSE model at epoch 283 of a completed 300-epoch run. weight/best_model.pth is 15636928 bytes; SHA256: 47fb0a029b0c5baa10b2452c70b12f54c958b548cb9aff300b85183d55f1ae70.
Inference
python scripts/inference.py
Evaluation and Visualization
python scripts/result.py
Outputs are written to results/. At the long-horizon endpoint (4.8 time units), MAE for (h, mx, my) is (1.5568e-3, 1.9634e-3, 1.7648e-3); averaging over all predicted steps gives (1.4063e-3, 1.8558e-3, 1.7632e-3). The paper's Table 3 two-times extrapolation means are (1.75e-3, 2.38e-3, 2.30e-3). This run uses one seed rather than the paper's five independently trained models, so the figures are not a strict like-for-like reproduction.
OneScience Repositories
| Platform | Main 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 |
Citation and License
- Paper: FluxNet.
- Original public repository; public dataset and its provenance. This model package is an independent reproduction.
中文说明
模型简介
FluxNet-ShallowWater-LAP 复现了 FluxNet 论文中的二维浅水 FluxNet-LAP 前推实验。它在 64x64 网格上预报水深和两个动量场。
模型描述
模型以 (h, mx, my) 为输入,预测下一状态。配置使用 64 个通道、六个残差块、5x5 核、3x3 输运邻域和五步前推训练。
使用场景
| 使用场景 | 说明 |
|---|---|
| 浅水预报 | 在规则网格上预报水深和动量 |
| 模拟加速 | 对比代理滚动预测与数值参考轨迹 |
使用方法
1. OneCode
2. 手动设置
硬件要求
- 训练和推理(inference)需要 Slurm 分配的 HIP/DCU 计算节点,不会自动回退到 CPU。
- 正式运行使用了一个 DCU、八个 CPU 核心及 30 GB 主机内存。GPU 运行未经验证。
下载模型
hf download OneScience-Group/FluxNet-ShallowWater-LAP --local-dir ./FluxNet-ShallowWater-LAP
cd FluxNet-ShallowWater-LAP
安装依赖
DCU 环境
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
pip install numpy h5py PyYAML matplotlib
GPU 环境
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
pip install numpy h5py PyYAML matplotlib
GPU 命令只涉及依赖安装,随附脚本已在 Slurm HIP/DCU 上验证。
训练数据
ModelScope 上的 OneScience/FluxNet-ShallowWater 数据集包含 50 条训练、20 条验证、50 条短时测试和 50 条长时测试轨迹,由论文的官方数值生成器生成。每条 HDF5 轨迹含有 h、mx、my 和 t。数据集在 Hugging Face 上没有镜像。请将其下载到模型目录。
modelscope download --dataset OneScience/FluxNet-ShallowWater --local_dir ./data
从模型包根目录运行命令。data.root 位于 config/config.yaml 中,默认为 ./data。
训练
在 Slurm 分配的 DCU 节点上运行以下命令。
python scripts/train.py
完整运行训练 300 轮,并写入 weight/best_model.pth。如需保留随附的 best_model.pth 和 last_model.pth,请在重新训练前备份。
训练权重
随附的模型权重(检查点)(checkpoint)是一次完整 300 轮训练中第 283 轮验证 MSE 最优的模型。weight/best_model.pth 大小为 15636928 bytes,SHA256 为 47fb0a029b0c5baa10b2452c70b12f54c958b548cb9aff300b85183d55f1ae70。
推理
python scripts/inference.py
评估与可视化
python scripts/result.py
输出写入 results/。在长时段终点(4.8 个时间单位),(h, mx, my) 的 MAE 为 (1.5568e-3, 1.9634e-3, 1.7648e-3),按所有预测步取平均,结果为 (1.4063e-3, 1.8558e-3, 1.7632e-3)。论文表 3 的两倍外推均值为 (1.75e-3, 2.38e-3, 2.30e-3)。本次运行使用一个种子,论文则使用独立训练的五个模型,因此这些数值并非严格同条件下的复现。
OneScience 仓库
引用与许可证
- Downloads last month
- 19