datasetops.abstract¶
This module defines a generic interface for datasets.
Examples¶
A simple dataset can be implemented as:
>>> class DummyDataset(AbstractDataset):
>>> def __len__(self):
>>> return 10
>>> def __getitem__(self, idx):
>>> return idx
>>>
>>> ds = DummyDataset()
>>> ds.__getitem__(0)
0
Module Contents¶
-
class
datasetops.abstract.ItemGetter¶ Bases:
abc.ABCAbstract base class implemented by classes that implement an index based get method
-
abstract
__getitem__(self, i: int)¶
-
abstract
-
class
datasetops.abstract.AbstractDataset¶ Bases:
datasetops.abstract.ItemGetterAbstract base class defining a generic dataset interface.
-
name=¶
-
cachable= False¶
-
shape¶
-
_origin¶
-
abstract
__len__(self)¶ Return the total number of elements in the dataset.
-
abstract
__getitem__(self, idx: int)¶ Returns the element at the specified index.
- Arguments:
idx {int} – the index from which to read the sample.
- Returns:
Tuple – A tuple representing the sample
-
get_transformation_graph(self)¶ Returns TransformationGraph of current dataset
-
__iter__(self)¶
-
property
generator(self)¶
-