Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
Base_2_2/Zone/CellData/diffusion_coefficient
listlengths
16.4k
16.4k
Base_2_2/Zone/CellData/flow
listlengths
16.4k
16.4k
Global/forcing_magnitude
listlengths
1
1
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.000044881300709676,0.00008668714872328565,0.00012660039647016674,0.00016516515461262316,0.0002026(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.0000158268230734393,0.00002860154381778557,0.00003953029226977378,0.00004918007107335143,0.000057(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.000011685323443089146,0.000020321511328802444,0.0000271182489086641,0.000032647680200170726,0.000(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.00007653275679331273,0.00015017163241282105,0.00022228772286325693,0.00029362700297497213,0.00036(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.00004038128099637106,0.00007766394992358983,0.00011300804908387363,0.00014693451521452516,0.00017(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.00007423823262797669,0.00014536675007548183,0.00021453415683936328,0.00028225037385709584,0.00034(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.000012316459105932154,0.00002158641473215539,0.00002902179585362319,0.00003519621168379672,0.0000(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.000016025969671318308,0.00002899918945331592,0.00004012508725281805,0.000049970079999184236,0.000(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.000015976132999639958,0.00002889645293180365,0.00003996334635303356,0.000049740254326025024,0.000(...TRUNCATED)
[ 0.009999999776482582 ]
[0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612,0.10000000149011612(...TRUNCATED)
[0.00001455567416996928,0.000026057799914269708,0.00003571097113308497,0.000044080690713599324,0.000(...TRUNCATED)
[ 0.009999999776482582 ]
End of preview. Expand in Data Studio

Example of usage:

import torch
from plaid.bridges import huggingface_bridge as hfb
from torch.utils.data import DataLoader


def reshape_all(batch: dict[str, torch.Tensor]) -> dict[str, torch.Tensor]:
    """Helper function that reshapes the flattened fields into images of sizes (128, 128)."""
    batch["diffusion_coefficient"] = batch["diffusion_coefficient"].reshape(
        -1, 128, 128
    )

    batch["flow"] = batch["flow"].reshape(-1, 128, 128)

    return batch


# Load the dataset from the hub
ds = hfb.load_dataset_from_hub(
    repo_id="Nionio/PDEBench_2D_DarcyFlow", split="all_samples"
)

# Rename the features
ds = ds.rename_columns(
    {
        "Base_2_2/Zone/CellData/diffusion_coefficient": "diffusion_coefficient",
        "Base_2_2/Zone/CellData/flow": "flow",
        "Global/forcing_magnitude": "forcing",
    }
)

# Convert to torch
ds = ds.with_format("torch")

# Reshape fields
ds = ds.map(reshape_all, batched=True)

# Example of usage with a DataLoader
dl = DataLoader(ds, batch_size=32, shuffle=True)
for batch in dl:
    for k, v in batch.items():
        print(k, v.shape)
        break
Downloads last month
224