Nionio commited on
Commit
097e327
·
verified ·
1 Parent(s): 3164032

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +107 -0
README.md CHANGED
@@ -1,4 +1,11 @@
1
  ---
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: Base_2_2/Zone/CellData/activator
@@ -21,3 +28,103 @@ configs:
21
  - split: train
22
  path: data/train-*
23
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ pretty_name: PDEBench 2D Diffusion-Reaction
6
+ tags:
7
+ - physics learning
8
+ - geometry learning
9
  dataset_info:
10
  features:
11
  - name: Base_2_2/Zone/CellData/activator
 
28
  - split: train
29
  path: data/train-*
30
  ---
31
+ ```yaml
32
+ legal:
33
+ owner: Takamoto, M et al. (https://darus.uni-stuttgart.de/dataset.xhtml?persistentId=doi:10.18419/darus-2986)
34
+ license: cc-by-4.0
35
+ data_production:
36
+ physics: 2D Diffusion-Reaction
37
+ type: simulation
38
+ script: Converted to PLAID format for standardized usage; no changes to data content.
39
+ num_samples:
40
+ train: 1000
41
+ storage_backend: hf_datasets
42
+ plaid:
43
+ version: 0.1.12
44
+
45
+ ```
46
+ This dataset was generated with [`plaid`](https://plaid-lib.readthedocs.io/), we refer to this documentation for additional details on how to extract data from `plaid_sample` objects.
47
+
48
+ The simplest way to use this dataset is to first download it:
49
+ ```python
50
+ from plaid.storage import download_from_hub
51
+
52
+ repo_id = "channel/dataset"
53
+ local_folder = "downloaded_dataset"
54
+
55
+ download_from_hub(repo_id, local_folder)
56
+ ```
57
+
58
+ Then, to iterate over the dataset and instantiate samples:
59
+ ```python
60
+ from plaid.storage import init_from_disk
61
+
62
+ local_folder = "downloaded_dataset"
63
+ split_name = "train"
64
+
65
+ datasetdict, converterdict = init_from_disk(local_folder)
66
+
67
+ dataset = datasetdict[split]
68
+ converter = converterdict[split]
69
+
70
+ for i in range(len(dataset)):
71
+ plaid_sample = converter.to_plaid(dataset, i)
72
+ ```
73
+
74
+ It is possible to stream the data directly:
75
+ ```python
76
+ from plaid.storage import init_streaming_from_hub
77
+
78
+ repo_id = "channel/dataset"
79
+
80
+ datasetdict, converterdict = init_streaming_from_hub(repo_id)
81
+
82
+ dataset = datasetdict[split]
83
+ converter = converterdict[split]
84
+
85
+ for sample_raw in dataset:
86
+ plaid_sample = converter.sample_to_plaid(sample_raw)
87
+ ```
88
+
89
+ Plaid samples' features can be retrieved like the following:
90
+ ```python
91
+ from plaid.storage import load_problem_definitions_from_disk
92
+ local_folder = "downloaded_dataset"
93
+ pb_defs = load_problem_definitions_from_disk(local_folder)
94
+
95
+ # or
96
+ from plaid.storage import load_problem_definitions_from_hub
97
+ repo_id = "channel/dataset"
98
+ pb_defs = load_problem_definitions_from_hub(repo_id)
99
+
100
+
101
+ pb_def = pb_defs[0]
102
+
103
+ plaid_sample = ... # use a method from above to instantiate a plaid sample
104
+
105
+ for t in plaid_sample.get_all_time_values():
106
+ for path in pb_def.get_in_features_identifiers():
107
+ plaid_sample.get_feature_by_path(path=path, time=t)
108
+ for path in pb_def.get_out_features_identifiers():
109
+ plaid_sample.get_feature_by_path(path=path, time=t)
110
+ ```
111
+
112
+ For those familiar with HF's `datasets` library, raw data can be retrieved without using the `plaid` library:
113
+ ```python
114
+ from datasets import load_dataset
115
+
116
+ repo_id = "channel/dataset"
117
+
118
+ datasetdict = load_dataset(repo_id)
119
+
120
+ for split_name, dataset in datasetdict.items():
121
+ for raw_sample in dataset:
122
+ for feat_name in dataset.column_names:
123
+ feature = raw_sample[feat_name]
124
+ ```
125
+ Notice that raw data refers to the variable features only, with a specific encoding for time variable features.
126
+
127
+ ### Dataset Sources
128
+
129
+ - **Papers:**
130
+ - [arxiv](https://arxiv.org/pdf/2210.07182)