File size: 2,978 Bytes
1f48b48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76fba2a
1f48b48
76fba2a
 
 
 
 
1f48b48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

license: mit
pretty_name: DeepONet linear ODE data
task_categories:
- tabular-regression
tags:
- deeponet
- operator-learning
- ode
- physics
- synthetic
size_categories:
- n<10K
configs:
- config_name: default
  data_files:
  - split: train
    path: train.parquet
  - split: test
    path: test.parquet
---


# DeepONet linear ODE data

Synthetic training data for learning the solution operator of the linear
first-order ODE

```

u'(t) = -k · u(t) + f(t),   u(0) = 0,   t ∈ [0, 1]

```

with a DeepONet. The input is a pair (f, k): `f` is a random smooth forcing
function and `k ∈ [0.1, 2]` is a damping constant. The target is the exact
solution `u(t) = ∫₀ᵗ e^{-k (t-s)} f(s) ds`.

Code that generates this dataset and trains a DeepONet on it:
**https://github.com/tha2002-tech/deeponet-ode-demo**

## Splits

| split | rows |
|-------|------|
| train | 2000 |
| test  | 500 |

## Schema

| column      | type            | length | meaning                                      |
|-------------|-----------------|--------|----------------------------------------------|
| `f_sensors` | list<float32>   | 100    | f evaluated at 100 equally spaced sensors on [0, 1] |
| `k`         | float32         | 1      | damping constant, uniform in [0.1, 2.0]       |
| `t`         | list<float32>   | 100    | query times (same 100-point grid as the sensors) |
| `u`         | list<float32>   | 100    | exact solution at `t`                         |

## Generation

- `f` is sampled from a zero-mean Gaussian random field on [0, 1] with an RBF
  kernel of length scale 0.2 and unit variance, on a 991-point grid.
- `u` is computed by the variation-of-constants integral with the cumulative
  trapezoid rule on that grid (error about 1e-6), then subsampled to the
  100-point sensor grid.
- Seed 0 for train, seed 0+1 for test.
- Produced by `scripts/generate_data.py` at commit `bf1ebab27e006e973715aa343437793bc2e78cf8` of the
  repository above. `metadata.json` in this repo records all parameters.
- Reproducibility: the same seed regenerates these files byte-for-byte on the
  same numpy/LAPACK build (eigenvector signs are canonicalized, so other builds
  should agree to floating-point rounding); if not, the regenerated data is
  equal in distribution. `metadata.json` records the numpy version and platform
  used.

## Usage

```python

from datasets import load_dataset

import numpy as np



ds = load_dataset("tha2002-tech/deeponet-ode-data")

f = np.array(ds["train"]["f_sensors"], dtype=np.float32)  # (N, 100)

k = np.array(ds["train"]["k"], dtype=np.float32)          # (N,)

u = np.array(ds["train"]["u"], dtype=np.float32)          # (N, 100)

```

## Reference

Lu, L., Jin, P., Pang, G., Zhang, Z., Karniadakis, G. E. (2021). Learning
nonlinear operators via DeepONet based on the universal approximation theorem
of operators. *Nature Machine Intelligence* 3, 218–229.