Iterator

Chainer provides some iterators that implement typical strategies to create mini-batches by iterating over datasets. SerialIterator is the simplest one, which extracts mini-batches in the main thread. MultiprocessIterator and MultithreadIterator are parallelized versions of SerialIterator. They maintain worker subprocesses and subthreads, respectively, to load the next mini-batch in parallel.

chainer.iterators.SerialIterator Dataset iterator that serially reads the examples.
chainer.iterators.MultiprocessIterator Dataset iterator that loads examples in parallel.
chainer.iterators.MultithreadIterator Dataset iterator that loads examples in parallel.
chainer.iterators.DaliIterator (Experimental) Iterator for DALI pipeline.

Order sampler examples

An Iterator iterates over a dataset according to an order represented by a 1-D array of indices. Order samplers are callables that are used by those iterators to generate this array.

chainer.iterators.OrderSampler Base class of all order samplers.
chainer.iterators.ShuffleOrderSampler Sampler that generates random orders.