espnet2.samplers.build_batch_sampler.build_batch_sampler
Less than 1 minute
espnet2.samplers.build_batch_sampler.build_batch_sampler
espnet2.samplers.build_batch_sampler.build_batch_sampler(type: str, batch_size: int, batch_bins: int, shape_files: Tuple[str, ...] | List[str], sort_in_batch: str = 'descending', sort_batch: str = 'ascending', drop_last: bool = False, min_batch_size: int = 1, fold_lengths: Sequence[int] = (), padding: bool = True, utt2category_file: str | None = None) → AbsSampler
Helper function to instantiate BatchSampler.
- Parameters:
- type – mini-batch type. “unsorted”, “sorted”, “folded”, “numel”, “length”, or “catbel”
- batch_size – The mini-batch size. Used for “unsorted”, “sorted”, “folded”, “catbel” mode
- batch_bins – Used for “numel” model
- shape_files – Text files describing the length and dimension of each features. e.g. uttA 1330,80
- sort_in_batch
- sort_batch
- drop_last
- min_batch_size – Used for “numel” or “folded” mode
- fold_lengths – Used for “folded” mode
- padding – Whether sequences are input as a padded tensor or not. used for “numel” mode