fabiencasenave commited on
Commit
2eac8b4
·
verified ·
1 Parent(s): 76d3dc8

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +114 -0
README.md CHANGED
@@ -1,4 +1,12 @@
1
  ---
 
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: Base_2_2/Zone
@@ -57,3 +65,109 @@ configs:
57
  - split: test
58
  path: data/test-*
59
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-sa-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ pretty_name: 2D quasistatic non-linear structural mechanics with finite elasticity
6
+ and topology variations
7
+ tags:
8
+ - physics learning
9
+ - geometry learning
10
  dataset_info:
11
  features:
12
  - name: Base_2_2/Zone
 
65
  - split: test
66
  path: data/test-*
67
  ---
68
+ <p align='center'>
69
+ <img src='https://i.ibb.co/JR7bWLNn/Logo-2-D-Multiscale-Hyperelasticity-2-consolas-100.png' alt='https://i.ibb.co/JR7bWLNn/Logo-2-D-Multiscale-Hyperelasticity-2-consolas-100.png' width='1000'/>
70
+ <img src='https://i.ibb.co/zHFQFnPR/2-D-Multiscale-Hyperelasticity.png' alt='https://i.ibb.co/zHFQFnPR/2-D-Multiscale-Hyperelasticity.png' width='1000'/>
71
+ </p>
72
+
73
+ ```yaml
74
+ owner: Safran
75
+ license: cc-by-sa-4.0
76
+ data_production:
77
+ type: simulation
78
+ physics: 2D quasistatic non-linear structural mechanics, finite elasticity (large
79
+ strains), P1 elements, compressible hyperelastic material
80
+ simulator: fenics
81
+ num_samples:
82
+ train: 764
83
+ test: 376
84
+ storage_backend: hf_datasets
85
+
86
+ ```
87
+ 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.
88
+
89
+ The simplest way to use this dataset is to first download it:
90
+ ```python
91
+ from plaid.storage import download_from_hub
92
+
93
+ repo_id = "channel/dataset"
94
+ local_folder = "downloaded_dataset"
95
+
96
+ download_from_hub(repo_id, local_folder)
97
+ ```
98
+
99
+ Then, to iterate over the dataset and instantiate samples:
100
+ ```python
101
+ from plaid.storage import init_from_disk
102
+
103
+ local_folder = "downloaded_dataset"
104
+ split_name = "train"
105
+
106
+ datasetdict, converterdict = init_from_disk(local_folder)
107
+
108
+ dataset = datasetdict[split]
109
+ converter = converterdict[split]
110
+
111
+ for i in range(len(dataset)):
112
+ plaid_sample = converter.to_plaid(dataset, i)
113
+ ```
114
+
115
+ It is possible to stream the data directly:
116
+ ```python
117
+ from plaid.storage import init_streaming_from_hub
118
+
119
+ repo_id = "channel/dataset"
120
+
121
+ datasetdict, converterdict = init_streaming_from_hub(repo_id)
122
+
123
+ dataset = datasetdict[split]
124
+ converter = converterdict[split]
125
+
126
+ for sample_raw in dataset:
127
+ plaid_sample = converter.sample_to_plaid(sample_raw)
128
+ ```
129
+
130
+ Sample features can then be retrieved as follows:
131
+ ```python
132
+ from plaid.storage import load_problem_definitions_from_disk
133
+ local_folder = "downloaded_dataset"
134
+ pb_defs = load_problem_definitions_from_disk(local_folder)
135
+
136
+ # or
137
+ from plaid.storage import load_problem_definitions_from_hub
138
+ repo_id = "channel/dataset"
139
+ pb_defs = load_problem_definitions_from_hub(repo_id)
140
+
141
+
142
+ pb_def = next(iter(pb_defs.values()))
143
+
144
+ plaid_sample = ... # use a method from above to instantiate a plaid sample
145
+
146
+ for t in plaid_sample.get_all_time_values():
147
+ for path in pb_def.input_features:
148
+ feature = plaid_sample.get_feature_by_path(path=path, time=t)
149
+ ...
150
+ for path in pb_def.output_features:
151
+ feature = plaid_sample.get_feature_by_path(path=path, time=t)
152
+ ...
153
+ ```
154
+
155
+ For those familiar with HF's `datasets` library, raw data can be retrieved without using the `plaid` library:
156
+ ```python
157
+ from datasets import load_dataset
158
+
159
+ repo_id = "channel/dataset"
160
+
161
+ datasetdict = load_dataset(repo_id)
162
+
163
+ for split_name, dataset in datasetdict.items():
164
+ for raw_sample in dataset:
165
+ for feat_name in dataset.column_names:
166
+ feature = raw_sample[feat_name]
167
+ ```
168
+ Notice that raw data refers to the variable features only, with a specific encoding for time variable features.
169
+
170
+ ### Dataset Sources
171
+
172
+ - **Papers:**
173
+ - [arxiv](https://arxiv.org/abs/2505.02974)