fabiencasenave commited on
Commit
00f78dd
·
verified ·
1 Parent(s): 05d9a2b

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
@@ -70,3 +77,103 @@ configs:
70
  - split: res_SENS
71
  path: data/res_SENS-*
72
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ pretty_name: ForceASR dataset
6
+ tags:
7
+ - physics learning
8
+ - geometry learning
9
  dataset_info:
10
  features:
11
  - name: Base_2_2/Zone
 
77
  - split: res_SENS
78
  path: data/res_SENS-*
79
  ---
80
+ <p align='center'>
81
+ <img src='https://i.ibb.co/gZtL8VrY/force-ASR-samples.gif' alt='https://i.ibb.co/gZtL8VrY/force-ASR-samples.gif' width='1000'/>
82
+ </p>
83
+
84
+ ```yaml
85
+ legal:
86
+ owner: RK 2423 FRASCAL (https://zenodo.org/records/7445749)
87
+ license: cc-by-4.0
88
+ data_production:
89
+ physics: phase-field fracture models for brittle fracture
90
+ type: simulation
91
+ script: Subset 'res-SENS' of the initial dataset, 1/5th time steps, converted to
92
+ PLAID format for standardized access; no changes to data content.
93
+ num_samples:
94
+ res_SENS: 28
95
+ storage_backend: hf_datasets
96
+ plaid:
97
+ version: 0.1.11.dev21+g94f13b9c8
98
+
99
+ ```
100
+ 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.
101
+
102
+ The simplest way to use this dataset is to first download it:
103
+ ```python
104
+ from plaid.storage import download_from_hub
105
+
106
+ repo_id = "channel/dataset"
107
+ local_folder = "downloaded_dataset"
108
+
109
+ download_from_hub(repo_id, local_folder)
110
+ ```
111
+
112
+ Then, to iterate over the dataset and instantiate samples:
113
+ ```python
114
+ from plaid.storage import init_from_disk
115
+
116
+ local_folder = "downloaded_dataset"
117
+ split_name = "train"
118
+
119
+ datasetdict, converterdict = init_from_disk(local_folder)
120
+
121
+ dataset = datasetdict[split]
122
+ converter = converterdict[split]
123
+
124
+ for i in range(len(dataset)):
125
+ plaid_sample = converter.to_plaid(dataset, i)
126
+ ```
127
+
128
+ It is possible to stream the data directly:
129
+ ```python
130
+ from plaid.storage import init_streaming_from_hub
131
+
132
+ repo_id = "channel/dataset"
133
+
134
+ datasetdict, converterdict = init_streaming_from_hub(repo_id)
135
+
136
+ dataset = datasetdict[split]
137
+ converter = converterdict[split]
138
+
139
+ for sample_raw in dataset:
140
+ plaid_sample = converter.sample_to_plaid(sample_raw)
141
+ ```
142
+
143
+ Plaid samples' features can be retrieved like the following:
144
+ ```python
145
+ from plaid.storage import load_problem_definitions_from_disk
146
+ local_folder = "downloaded_dataset"
147
+ pb_defs = load_problem_definitions_from_disk(local_folder)
148
+
149
+ # or
150
+ from plaid.storage import load_problem_definitions_from_hub
151
+ repo_id = "channel/dataset"
152
+ pb_defs = load_problem_definitions_from_hub(repo_id)
153
+
154
+
155
+ pb_def = pb_defs[0]
156
+
157
+ plaid_sample = ... # use a method from above to instantiate a plaid sample
158
+
159
+ for t in plaid_sample.get_all_time_values():
160
+ for path in pb_def.get_in_features_identifiers():
161
+ plaid_sample.get_feature_by_path(path=path, time=t)
162
+ for path in pb_def.get_out_features_identifiers():
163
+ plaid_sample.get_feature_by_path(path=path, time=t)
164
+ ```
165
+
166
+ For those familiar with HF's `datasets` library, raw data can be retrieved without using the `plaid` library:
167
+ ```python
168
+ from datasets import load_dataset
169
+
170
+ repo_id = "channel/dataset"
171
+
172
+ datasetdict = load_dataset(repo_id)
173
+
174
+ for split_name, dataset in datasetdict.items():
175
+ for raw_sample in dataset:
176
+ for feat_name in dataset.column_names:
177
+ feature = raw_sample[feat_name]
178
+ ```
179
+ Notice that raw data refers to the variable features only, with a specific encoding for time variable features.