nnmnkwii.preprocessing.remove_zeros_frames

nnmnkwii.preprocessing.remove_zeros_frames(x, eps=1e-07)[source]

Remove zeros frames.

Given a feature matrix, remove all zeros frames as well as trailing ones.

Parameters
  • x (numpy.ndarray) – 2d feature matrix, shape (T x D)

  • eps (float) – Values smaller than eps considered as zeros.

Returns

Zeros-removed 2d feature matrix, shape (T' x D).

Return type

numpy.ndarray

Examples

>>> import numpy as np
>>> from nnmnkwii.preprocessing import remove_zeros_frames
>>> x = np.random.rand(100,10)
>>> y = remove_zeros_frames(x)