dataset.py 662 字节
Newer Older
1
class Dataset(object):
2 3
    def __init__(self):
        pass
4 5 6 7 8
    
    def _load_metadata(self):
        raise NotImplementedError
    
    def _get_example(self):
9 10 11 12 13
        """return a Record (or Example, Instance according to your glossary)"""
        raise NotImplementedError
    
    def _batch_examples(self, minibatch):
        """get a list of examples, return a batch, whose structure is the same as an example"""
14 15 16 17 18 19 20 21 22 23 24
        raise NotImplementedError
    
    def _prepare_metadata(self):
        raise NotImplementedError
    
    def __getitem__(self, index):
        raise NotImplementedError
    
    def __iter__(self):
        raise NotImplementedError