def __init__(self, db, keys, rng=np.random):
super(DataIterator, self).__init__()
self.db = db
self.keys = keys
self.rng = rng
# If there is only one key, wrap it in a list
if isinstance(self.keys, str):
self.keys = [self.keys]
# Retrieve the data specification (shape & dtype) for all data objects
# Assumes that all samples have the same shape and data type
self.spec = db.get_data_specification(0)
评论列表
文章目录