chainer.iterators.SerialIterator¶
-
class
chainer.iterators.SerialIterator(dataset, batch_size, repeat=True, shuffle=True)[source]¶ Dataset iterator that serially reads the examples.
This is a simple implementation of
Iteratorthat just visits each example in either the order of indexes or a shuffled order.To avoid unintentional performance degradation, the
shuffleoption is set toTrueby default. For validation, it is better to set it toFalsewhen the underlying dataset supports fast slicing. If the order of examples has an important meaning and the updater depends on the original order, this option should be set toFalse.This iterator saves
-1instead ofNonein snapshots since some serializers do not supportNone.Parameters: - dataset – Dataset to iterate.
- batch_size (int) – Number of examples within each batch.
- repeat (bool) – If
True, it infinitely loops over the dataset. Otherwise, it stops iteration at the end of the first epoch. - shuffle (bool) – If
True, the order of examples is shuffled at the beginning of each epoch. Otherwise, examples are extracted in the order of indexes.
Methods
-
finalize()[source]¶ Finalizes the iterator and possibly releases the resources.
This method does nothing by default. Implementation may override it to better handle the internal resources.
Attributes
-
epoch_detail¶
-
previous_epoch_detail¶