LION.data_loaders.LIONDataset¶
LIONDataset: the base class of LION’s datasets.
Classes
A torch |
- class LION.data_loaders.LIONDataset.LIONDataset[source]¶
Bases:
DatasetA torch
Datasetthat 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 onLIONDataset, the class the record names (allow: seeLION.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=Truethe contents of their files too (the record must have been made withhash_files=True); a difference gives a warning. A record of aSubsetgives thatSubsetof the dataset.argumentsreplace recorded ones (e.g.parametersfromparameters_from_file, changed). That makes another dataset: the whole of it, not compared with the record (itssubset, if any, isrecord.subset.indices).