CoolFace
Datasetpublic

PhysArena/ForceASR

owner: RK 2423 FRASCAL (https://zenodo.org/records/7445749) license: cc-by-4.0 data_production: type: simulation physics: phase-field fracture models for brittle fracture script: Subset 'res-SENS' of the initial dataset, 1/5th time steps, converted to PLAID format for standardized access; no changes to data content. num_samples: res_SENS: 28 storage_backend: hf_datasets This dataset was generated with plaid, we refer to this documentation for additional details on how to… See the full description on the dataset page: https://huggingface.co/datasets/PhysArena/ForceASR.

sourceHugging Facecc-by-4.0updated 4mo agoView on Hugging Face
0likes68downloads
Dataset Card

<p align='center'> <img src='https://i.ibb.co/gZtL8VrY/force-ASR-samples.gif' alt='https://i.ibb.co/gZtL8VrY/force-ASR-samples.gif' width='1000'/> </p>

yaml
owner: RK 2423 FRASCAL (https://zenodo.org/records/7445749)
license: cc-by-4.0
data_production:
  type: simulation
  physics: phase-field fracture models for brittle fracture
  script: Subset 'res-SENS' of the initial dataset, 1/5th time steps, converted to
    PLAID format for standardized access; no changes to data content.
num_samples:
  res_SENS: 28
storage_backend: hf_datasets

This dataset was generated with `plaid`, we refer to this documentation for additional details on how to extract data from plaid_sample objects.

The simplest way to use this dataset is to first download it:

python
from plaid.storage import download_from_hub

repo_id = "channel/dataset"
local_folder = "downloaded_dataset"

download_from_hub(repo_id, local_folder)

Then, to iterate over the dataset and instantiate samples:

python
from plaid.storage import init_from_disk

local_folder = "downloaded_dataset"
split_name = "train"

datasetdict, converterdict = init_from_disk(local_folder)

dataset = datasetdict[split]
converter = converterdict[split]

for i in range(len(dataset)):
    plaid_sample = converter.to_plaid(dataset, i)

It is possible to stream the data directly:

python
from plaid.storage import init_streaming_from_hub

repo_id = "channel/dataset"

datasetdict, converterdict = init_streaming_from_hub(repo_id)

dataset = datasetdict[split]
converter = converterdict[split]

for sample_raw in dataset:
    plaid_sample = converter.sample_to_plaid(sample_raw)

Sample features can then be retrieved as follows:

python
from plaid.storage import load_problem_definitions_from_disk
local_folder = "downloaded_dataset"
pb_defs = load_problem_definitions_from_disk(local_folder)

# or
from plaid.storage import load_problem_definitions_from_hub
repo_id = "channel/dataset"
pb_defs = load_problem_definitions_from_hub(repo_id)


pb_def = next(iter(pb_defs.values()))

plaid_sample = ... # use a method from above to instantiate a plaid sample

for t in plaid_sample.get_all_time_values():
    for path in pb_def.input_features:
        feature = plaid_sample.get_feature_by_path(path=path, time=t)
        ...
    for path in pb_def.output_features:
        feature = plaid_sample.get_feature_by_path(path=path, time=t)
        ...

For those familiar with HF's datasets library, raw data can be retrieved without using the plaid library:

python
from datasets import load_dataset

repo_id = "channel/dataset"

datasetdict = load_dataset(repo_id)

for split_name, dataset in datasetdict.items():
    for raw_sample in dataset:
        for feat_name in dataset.column_names:
            feature = raw_sample[feat_name]

Notice that raw data refers to the variable features only, with a specific encoding for time variable features.