glitchgan.data

Utilities for downloading the GlitchGAN training dataset from HuggingFace.

Module Contents

glitchgan.data.REPO_ID = 'tomdooney/deepextractor-glitch-reconstructions'[source]
glitchgan.data.download_data(data_dir: str | pathlib.Path = 'data/', include_derivatives: bool = False, force: bool = False) dict[str, pathlib.Path][source]

Download the GlitchGAN training dataset from HuggingFace.

Downloads DeepExtractor reconstructions of seven LIGO glitch classes (35,000 samples, balanced across Blip, Fast Scattering, Koi Fish, Low Frequency Burst, Scattered Light, Tomte, and Whistle) from tomdooney/deepextractor-glitch-reconstructions on HuggingFace.

Parameters:
  • data_dir – Directory to save downloaded files. Created if it does not exist.

  • include_derivatives – If True, also download the first-order time-derivative array required for cDVGAN training (adds ~2.1 GB).

  • force – If True, re-download files even if they already exist locally.

Returns:

Mapping of {"samples", "labels", "label_order"} (and "derivatives" if requested) to their local file paths.

Return type:

dict[str, Path]

Examples

>>> from glitchgan import download_data
>>> paths = download_data("data/")
>>> import numpy as np
>>> X = np.load(paths["samples"])   # (35000, 8192)
>>> y = np.load(paths["labels"])    # (35000, 7)