示例#1
0
 def __getitem__(self, index):
     # Load acoustic feature and pad
     x_batch = [
         self._sample(self._load_feat(x_file)) for x_file in self.X[index]
     ]
     x_pad_batch = pad_sequence(x_batch, batch_first=True)
     return generate_spec_aug_data(spec=(x_pad_batch, ),
                                   config=self.task_config)
示例#2
0
 def _process_x_pad_batch(self, x_pad_batch):
     if self.libri_root is not None:
         x_pad_batch = x_pad_batch.unsqueeze(
             1)  # (batch_size, channel=1, seq_len)
         feat_list = self.extracter(x_pad_batch)
     return generate_spec_aug_data(feat_list, config=self.task_config)