espnet2.iterators.category_iter_factory.CategoryIterFactory
Less than 1 minute
espnet2.iterators.category_iter_factory.CategoryIterFactory
class espnet2.iterators.category_iter_factory.CategoryIterFactory(dataset, batches: AbsSampler | Sequence[Sequence[Any]], num_iters_per_epoch: int | None = None, seed: int = 0, sampler_args: dict | None = None, shuffle: 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