--- license: apache-2.0 language: - en tags: - OneScience - fluid-dynamics - darcy-flow - pytorch library_name: pytorch ---

FAST-DeepONet-DarcyFlow

# Model Introduction FAST-DeepONet-DarcyFlow predicts a steady Darcy pressure field from a permeability field in a small-data setting. Paper: [FAST-DeepONet: Factor-Augmented Branch Representations for High-Dimensional PDE Inputs in the Small-Sample Regime](https://arxiv.org/pdf/2608.15408). # 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 [Open the OneCode environment](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home). ## 2. Manual Setup **Hardware requirements** A GPU or DCU is recommended. CPU can be used for a small inference check. ### Download the Model Package ```bash hf download OneScience-Group/FAST-DeepONet-DarcyFlow --local-dir ./FAST-DeepONet-DarcyFlow cd FAST-DeepONet-DarcyFlow ``` ### Set Up the Runtime Environment **DCU environment** ```bash 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** ```bash 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: ```bash 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: ```bash 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 ```bash python scripts/inference.py ``` ### Evaluation and Visualization ```bash 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](https://arxiv.org/pdf/2608.15408). Official implementation: [fast-deeponet](https://github.com/kwonji39/fast-deeponet). Verify the generated dataset's release terms before redistribution.