FAST-DeepONet-DarcyFlow
Model Introduction
FAST-DeepONet-DarcyFlow predicts a steady Darcy pressure field from a permeability field in a small-data setting.
Model Description
This package reproduces the localized-inclusion Darcy flow experiment in Table 2. A factor-augmented branch network and coordinate trunk predict a pressure field on a 64x64 grid.
Intended Use
| Task | Description |
|---|---|
| Darcy pressure prediction | Estimate steady pressure from permeability fields |
| PDE surrogate research | Study low-data operator learning |
Usage
1. OneCode
2. Manual Setup
Hardware requirements
A GPU or DCU is recommended. CPU can be used for a small inference check.
Download the Model Package
hf download OneScience-Group/FAST-DeepONet-DarcyFlow --local-dir ./FAST-DeepONet-DarcyFlow
cd FAST-DeepONet-DarcyFlow
Set Up the Runtime Environment
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 scipy 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 scipy pyyaml matplotlib
Training Data
Run the included script from the model package root to generate the Darcy-inclusion data. It follows the paper's experiment settings with seed 33 and needs only CPU, NumPy, and SciPy:
python scripts/generate_data.py
The script creates 100 examples under data/train/ (60), data/tune/ (10), data/calib/ (20), and data/test/ (10), plus data/DATA_MANIFEST.json. Each .npz contains init_value, last_value, and sparse_mask, each with 4096 float32 values. All three arrays in all 100 regenerated examples were checked against the data used for the bundled checkpoint and matched exactly. No generated dataset files are bundled with this model package.
Training
From the model package root, run:
python scripts/train.py
The configured run is 300 epochs. The training script no longer requires a particular Slurm installation; use the package in a suitable GPU or DCU environment.
Checkpoint
The trained checkpoint is weight/best_model.pth (1,240,394 bytes; SHA256 a6dd45b968a3d8f48f180f09bf4117d566c0aa95821f88ad7a608b925ecabdb4). The reproduced test mean relative L2 is 0.0958688; Table 2 reports 0.0925 +/- 0.0019 over five runs and a larger test set, so the figures are only approximately comparable.
Inference
python scripts/inference.py
Evaluation and Visualization
python scripts/result.py
Official OneScience Information
| 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: FAST-DeepONet. Official implementation: fast-deeponet. Verify the generated dataset's release terms before redistribution.
中文说明
模型简介
FAST-DeepONet-DarcyFlow 在小数据量条件下根据渗透率场预测稳态达西压力场。
论文 FAST-DeepONet:小样本条件下用于高维 PDE 输入的因子增强分支表征。
模型描述
本模型包复现了表 2 中带局部夹杂的达西流(Darcy flow)实验。因子增强分支网络和坐标主干网络预测 64x64 网格上的压力场。
预期用途
| 任务 | 说明 |
|---|---|
| 达西压力预测 | 根据渗透率场估算稳态压力 |
| PDE 代理求解研究 | 研究低数据量条件下的算子学习 |
使用方法
1. OneCode
2. 手动设置
硬件要求
建议使用 GPU 或 DCU。可使用 CPU 进行小规模推理(inference)检查。
下载模型包
hf download OneScience-Group/FAST-DeepONet-DarcyFlow --local-dir ./FAST-DeepONet-DarcyFlow
cd FAST-DeepONet-DarcyFlow
配置运行环境
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 scipy 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 scipy pyyaml matplotlib
训练数据
从模型包根目录运行随附脚本,生成达西夹杂数据。脚本遵循论文的实验设置,使用种子 33,仅需要 CPU、NumPy 和 SciPy。
python scripts/generate_data.py
脚本在 data/train/(60)、data/tune/(10)、data/calib/(20)和 data/test/(10)下生成共 100 个样本,另生成 data/DATA_MANIFEST.json。每个 .npz 文件包含 init_value、last_value 和 sparse_mask,每个数组包含 4096 个 float32 数值。对重新生成的全部 100 个样本中的所有三个数组,均与随附模型权重(检查点)(checkpoint)所用的数据做了核对,结果完全一致。模型包未附带生成的数据集文件。
训练
从模型包根目录运行以下命令。
python scripts/train.py
配置的训练轮数为 300。训练脚本不再依赖特定的 Slurm 安装,请在适合的 GPU 或 DCU 环境中使用本模型包。
模型权重(检查点)
训练得到的模型权重(检查点)为 weight/best_model.pth(1,240,394 bytes,SHA256 a6dd45b968a3d8f48f180f09bf4117d566c0aa95821f88ad7a608b925ecabdb4)。复现测试的平均相对 L2 为 0.0958688。表 2 在更大的测试集上运行五次,报告的结果为 0.0925 +/- 0.0019,因此两者仅可作近似比较。
推理
python scripts/inference.py
评估与可视化
python scripts/result.py
OneScience 官方信息
引用与许可证
论文为 FAST-DeepONet。官方实现为 fast-deeponet。再次分发前请核对所生成数据集的发布条款。
- Downloads last month
- 28