File size: 3,918 Bytes
b887635
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
license: apache-2.0
language:
- en
tags:
- OneScience
- fluid-dynamics
- darcy-flow
- pytorch
library_name: pytorch
---

<p align="center"><strong><span style="font-size: 30px;">FAST-DeepONet-DarcyFlow</span></strong></p>

# 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.