|TensorFlow 1 version||View source on GitHub|
Base object for fitting to a sequence of data, such as a dataset.
Compat aliases for migration
See Migration guide for more details.
Sequence must implement the
__getitem__ and the
If you want to modify your dataset between epochs you may implement
__getitem__ should return a complete batch.
Sequence are a safer way to do multiprocessing. This structure guarantees
that the network will only train once
on each sample per epoch which is not the case with generators.
from skimage.io import imread from skimage.transform import resize import numpy as np import math # Here, `x_set` is list of path to the images # and `y_set` are the associated classes. class CIFAR10Sequence(Sequence): def __init__(self, x_set, y_set, batch_size): self.x, self.y = x_set, y_