xnn.common.data.hub.base.load_dataset#
- xnn.common.data.hub.base.load_dataset(name, *, split=None, cutoff=None, cache_dir=None, **kwargs)[source]#
Download and preprocess an upstream dataset in one call.
Looks up the builder registered under
nameand returns its data as xnn structure dicts, optionally wrapped as ready-to-trainAtomicDatasetobjects.Files are downloaded (and cached, verified by MD5) under
cache_dir / name– by default the repository’sdatasets/directory, so re-running is instant and offline. Seedefault_cache_dir().- Parameters:
name (str) – Registered dataset name; see
list_datasets()(e.g."rmd17").split (str, optional) – Which split to return.
None(default) returns a mapping{split_name: data}; a name (e.g."train") returns just that split. Available splits are dataset-specific.cutoff (float, optional) – If given, each returned split is wrapped in an
AtomicDatasetbuilt with this neighbor-list cutoff (ready for aDataLoader). If omitted, raw lists of structure dicts are returned.cache_dir (str or pathlib.Path, optional) – Base cache directory. Defaults to
default_cache_dir().**kwargs – Forwarded to the builder’s
DatasetBuilder.load()(e.g. rMD17’smolecule,fold,units).
- Returns:
Structure-dict lists (or
AtomicDatasets whencutoffis set), as a per-split mapping whensplit is Noneelse for the single split.- Return type:
dict or list or AtomicDataset
Examples
>>> from xnn.common.data import load_dataset >>> splits = load_dataset("rmd17", molecule="aspirin") # {"train","test"} >>> train = load_dataset("rmd17", molecule="aspirin", split="train", cutoff=5.0)