nnsvs.train_util.collate_fn_random_segments

nnsvs.train_util.collate_fn_random_segments(batch, max_time_frames=256)[source]

Collate function with random segments

Use segmented frames instead of padded entire frames. No padding is performed.

Warning

max_time_frames must be larger than the shortest sequence in the training data.

Parameters:
  • batch (tuple) – tupls of lit - x[0] (ndarray,int) : list of (T, D_in) - x[1] (ndarray,int) : list of (T, D_out)

  • max_time_frames (int, optional) – Number of time frames. Defaults to 256.

Returns:

Tuple of batch
  • x (FloatTensor) : Network inputs (B, max(T), D_in)

  • y (FloatTensor) : Network targets (B, max(T), D_out)

  • lengths (LongTensor): Input lengths

Return type:

tuple