espnet2.train.collate_fn.DiarCollateFn
Less than 1 minute
espnet2.train.collate_fn.DiarCollateFn
class espnet2.train.collate_fn.DiarCollateFn(num_spk: int, float_pad_value: float | int = 0.0, int_pad_value: int = -32768, label_key: str = 'spk_labels')
Bases: CommonCollateFn
common_collate_fn() with the speaker labels widened to num_spk columns.
A recording in which fewer than num_spk speakers speak, e.g. one without speech (an RTTM with only its END line gives a (length, 0) label), gets all-zero columns up to num_spk, so that it can share a mini-batch with the others. Labels with more than num_spk columns are kept as they are.
