HDF5Dataset#

class deepinv.datasets.HDF5Dataset(path, train=True, split=None, transform=None, load_physics_generator_params=False, dtype=torch.float, complex_dtype=torch.cfloat)[source]#

Bases: Dataset

DeepInverse HDF5 dataset with signal/measurement pairs (x, y).

If there is no training ground truth (i.e. x_train) in the dataset file, the dataset returns the measurement again as the signal.

Optionally also return physics generator params as a dict per sample (x, y, params), if one was used during data generation.

Note

We support all dtypes supported by h5py including complex numbers, which will be stored as complex dtype.

Parameters:
  • path (str) – Path to the folder containing the dataset (one or multiple HDF5 files).

  • train (bool) – Set to True for training and False for testing. If split argument used, then train is ignored.

  • split (str) – overrides train argument if not None. Custom dataset split e.g. “train”, “test” or “val”, which selects the split name used when generating the dataset.

  • transform (Transform, Callable) – A deepinv or torchvision transform to apply to the data.

  • load_physics_generator_params (bool) – load physics generator params from dataset if they exist (e.g. if dataset created with deepinv.datasets.generate_dataset())

  • dtype (torch.dtype, str) – cast all real-valued data to this dtype.

  • complex_dtype (torch.dtype, str) – cast all complex-valued data to this dtype.

Examples using HDF5Dataset:#

Imaging inverse problems with adversarial networks

Imaging inverse problems with adversarial networks

Image deblurring with custom deep explicit prior.

Image deblurring with custom deep explicit prior.

Creating your own dataset

Creating your own dataset

Tour of MRI functionality in DeepInverse

Tour of MRI functionality in DeepInverse

Training a reconstruction network.

Training a reconstruction network.

DPIR method for PnP image deblurring.

DPIR method for PnP image deblurring.

Regularization by Denoising (RED) for Super-Resolution.

Regularization by Denoising (RED) for Super-Resolution.

Self-supervised learning with Equivariant Imaging for MRI.

Self-supervised learning with Equivariant Imaging for MRI.

Self-supervised learning from incomplete measurements of multiple operators.

Self-supervised learning from incomplete measurements of multiple operators.

Self-supervised denoising with the Neighbor2Neighbor loss.

Self-supervised denoising with the Neighbor2Neighbor loss.

Self-supervised denoising with the Generalized R2R loss.

Self-supervised denoising with the Generalized R2R loss.

Self-supervised learning with measurement splitting

Self-supervised learning with measurement splitting

Self-supervised denoising with the SURE loss.

Self-supervised denoising with the SURE loss.

Self-supervised denoising with the UNSURE loss.

Self-supervised denoising with the UNSURE loss.

Deep Equilibrium (DEQ) algorithms for image deblurring

Deep Equilibrium (DEQ) algorithms for image deblurring

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Learned iterative custom prior

Learned iterative custom prior

Unfolded Chambolle-Pock for constrained image inpainting

Unfolded Chambolle-Pock for constrained image inpainting

Vanilla Unfolded algorithm for super-resolution

Vanilla Unfolded algorithm for super-resolution