espnet2.iterators.sequence_iter_factory.SequenceIterFactory
Less than 1 minute
espnet2.iterators.sequence_iter_factory.SequenceIterFactory
class espnet2.iterators.sequence_iter_factory.SequenceIterFactory(dataset, batches: AbsSampler | Sequence[Sequence[Any]], num_iters_per_epoch: int | None = None, seed: int = 0, shuffle: bool = False, shuffle_within_batch: bool = False, num_workers: int = 0, collate_fn=None, pin_memory: bool = False)
Bases: AbsIterFactory
Build iterator for each epoch.
This class simply creates pytorch DataLoader except for the following points:
- The random seed is decided according to the number of epochs. This feature
guarantees reproducibility when resuming from middle of training process.
- Enable to restrict the number of samples for one epoch. This features controls the interval number between training and evaluation.
build_iter(epoch: int, shuffle: bool | None = None) → DataLoader