nnmnkwii.util.adjast_frame_length¶
-
nnmnkwii.util.
adjast_frame_length
(x, y, pad=True, ensure_even=False)[source]¶ Adjast frame lengths given two feature matrices.
This ensures that two feature matrices have same number of frames, by padding zeros to the end or removing last frames.
Parameters: Returns: Pair of adjasted feature matrices, of each shape (
T x D
).Return type: Tuple
Examples
>>> from nnmnkwii.util import adjast_frame_length >>> import numpy as np >>> x = np.zeros((10, 1)) >>> y = np.zeros((11, 1)) >>> x, y = adjast_frame_length(x, y) >>> assert len(x) == len(y)