LION.data_loaders.LIONDataset

LIONDataset: the base class of LION’s datasets.

Classes

LIONDataset()

A torch Dataset that LION can save and make again.


class LION.data_loaders.LIONDataset.LIONDataset[source]

Bases: Dataset

A torch Dataset that LION can save and make again.

It only adds instantiate(): what a sample is, and how data are read, depend on the inverse problem, so they are left to each dataset. For its record (LION.data_loaders.data_record) a LION dataset keeps its constructor arguments as attributes of the same names, and may list its samples (sample_ids()) and the files they are read from (sample_files()).

classmethod instantiate(source, *, check_files=False, allow=(), **arguments)[source]

The dataset a saved file describes.

source: a data record, a model’s file (or the dict read from it) saved with one, or the dataset’s spec (or its file). Called on a dataset class it makes that class; called on LIONDataset, the class the record names (allow: see LION.utils.spec.build).

The dataset is made alone, without noise: noise is part of the experiment. If the record’s data had noise, a warning says how to get it (Experiment.instantiate(source) for data made by an experiment).

The dataset’s samples are compared with the record’s, and with check_files=True the contents of their files too (the record must have been made with hash_files=True); a difference gives a warning. A record of a Subset gives that Subset of the dataset.

arguments replace recorded ones (e.g. parameters from parameters_from_file, changed). That makes another dataset: the whole of it, not compared with the record (its subset, if any, is record.subset.indices).

classmethod parameters_from_file(source, *, allow=())[source]

What default_parameters() gives, as source (as in instantiate) recorded it: the dataset’s parameters, to change and make the dataset with (LIDC_IDRI(mode, geometry, parameters), or instantiate(source, parameters=parameters)).

static cite(cite_format='bib')[source]

Where the dataset comes from: its paper’s citation, BibTeX (“bib”) or “MLA” (LION.utils.citation); None if it has none. Datasets from a paper define it.