File size: 3,753 Bytes
5978445 | 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 | ---
license: other
language:
- en
tags:
- OneScience
- darcy-flow
- neural-operator
- thompson-sampling
---
# NOTS-DarcyFlowRate
## Model Introduction
This package reproduces the Darcy flow-rates experiment in [Thompson Sampling in Function Spaces via Neural Operators](https://arxiv.org/abs/2506.21894). A neural operator predicts a 16x16 pressure field from a permeability field, then supports sequential selection using a negative total-flow objective.
## Model Description
The run completed ten independent trials with 300 queries per trial on one DCU. The included `weight/best_model.pt` contains the selected trained model. The public checkpoint changes only the configuration fingerprint for portable data/output paths; its model parameter tensors are identical to the original run.
The published checkpoint SHA256 is `dac0b15574242acabd25d5bc52b7a415ec72e1d55411433402affe61876131f7`; the original training checkpoint SHA256 was `2cf139f9cf75a01064fe54b5e8ba0d4e58a4b76a39aa7cf924320acbee4336b2`. The archived `results/inference_metrics.json` records the original file hash; rerunning inference writes a fresh metric file for the published checkpoint.
## Intended Use
| Task | Description |
| --- | --- |
| Darcy surrogate inference | Predict pressure fields on 16x16 permeability grids |
| Sequential optimization | Study neural-operator Thompson sampling for flow-rate objectives |
## Usage
### Download the Model Package
```bash
hf download OneScience-Group/NOTS-DarcyFlowRate --local-dir ./NOTS-DarcyFlowRate
cd NOTS-DarcyFlowRate
```
### Install Dependencies
Use an allocated GPU/DCU compute node for the provided scripts. The tested formal run used a PyTorch DCU environment; CPU execution of the full pipeline is not claimed.
```bash
pip install -r requirements.txt
pip install 'modelscope[datasets]'
```
### Training Data
Hugging Face hosts only this model package, not a dataset mirror. Download the author's original 16x16 Darcy train/test tensors from [OneScience/NOTS-Darcy-16 on ModelScope](https://www.modelscope.cn/datasets/OneScience/NOTS-Darcy-16):
```bash
modelscope download --dataset OneScience/NOTS-Darcy-16 --local_dir ./data
```
The package expects `data/darcy_train_16.pt` with 1,000 pairs and `data/darcy_test_16.pt` with 50 pairs. The original files are from the [NOTS authors' repository](https://github.com/csiro-funml/nots/tree/main/data).
### Train
From the package root on an allocated GPU/DCU compute node:
```bash
python scripts/train.py
```
This runs ten configured seeds and 300 queries per seed. Save a copy of the bundled checkpoint and results before retraining.
### Inference and Results
```bash
python scripts/inference.py
python scripts/result.py
```
The reproduced final average regret was `0.289031 +/- 0.016963` across ten trials, versus `0.012 +/- 0.001` in paper Table 1. The measured test pressure-field mean relative L2 was `0.339917`. The regret is far from the paper result; this package is a documented reproduction attempt, not a paper-accuracy claim.
## OneScience Repositories
| Platform | Main repository | Skills repository |
| --- | --- | --- |
| Gitee | [OneScience](https://gitee.com/onescience-ai/onescience) | [OneSkills](https://gitee.com/onescience-ai/oneskills) |
| GitHub | [OneScience](https://github.com/onescience-ai/OneScience) | [OneSkills](https://github.com/onescience-ai/oneskills) |
## Citation and License
- Paper: [Thompson Sampling in Function Spaces via Neural Operators](https://arxiv.org/abs/2506.21894).
- Dataset: [NOTS authors' data directory](https://github.com/csiro-funml/nots/tree/main/data), originally from NeuralOperator and redistributed there under the accompanying MIT license. The data is hosted separately on ModelScope.
|