File size: 2,599 Bytes
10ab127 | 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 | ---
license: apache-2.0
library_name: pytorch
tags:
- OneScience
- neural-operator
- darcy-flow
---
# SirenFNO: Darcy 32x32
This package reproduces the full-spectrum SirenFNO experiment for two-dimensional Darcy flow in Table 2 of the [SirenFNO paper](https://ijcai.org/proceedings/2026/0535.pdf). The model maps a permeability field to its pressure solution. It has four spectral blocks, width 32, and was trained for 500 epochs on 1,000 samples.
## Results
The reloaded checkpoint achieves a mean per-sample relative L2 error of **0.04524468** on 200 test fields. The paper reports **0.0351**; this run is about 28.9% higher. The loss definition and some unspecified implementation details may differ, so this is not a strict same-condition comparison. The original training report and plots are in `results/`.
## Download
```bash
hf download OneScience-Group/SirenFNO --local-dir ./SirenFNO
cd SirenFNO
```
The original 32x32 Darcy tensors are published by the [NeuralOperator team on Zenodo](https://zenodo.org/records/12784353). The same two files are mirrored for this experiment in the [OneScience/SirenFNO-Darcy32 ModelScope dataset](https://www.modelscope.cn/datasets/OneScience/SirenFNO-Darcy32). No dataset files are included in this Hugging Face model repository.
```bash
modelscope download --dataset OneScience/SirenFNO-Darcy32 --local_dir ./data
```
Run the commands below from the model directory. The published configuration reads `data/darcy_train_32.pt` and `data/darcy_test_32.pt` and writes to `results/`. Each file contains float32 `x` (permeability) and `y` (pressure) tensors on a 32x32 grid. The inference script checks the data SHA256 against the checkpoint.
## Environment and usage
Use Python 3.11, PyTorch with a supported GPU or DCU, `onescience[cfd-gpu]` or `onescience[cfd-dcu]`, PyYAML, and Matplotlib. On a cluster, run model computation on an allocated accelerator node.
```bash
python scripts/inference.py --config config/config.yaml
python scripts/result.py --config config/config.yaml
```
To start a new 500-epoch training run, move the included `weight/` and `results/` outside the model directory first, then run `python scripts/train.py --config config/config.yaml`. The published inference accepts a different data/output location but retains the model-configuration and data-hash checks. The weights are unchanged from the original run.
Checkpoint: `weight/best_model.pth` (SHA256 `ceb2392d5ba68e386f08e0f117ea1705df1f3a0185d3cef0971f07951113ce1e`). The dataset's original use and redistribution terms should be checked at the Zenodo source.
|