nnmnkwii.paramgen.reshape_means

nnmnkwii.paramgen.reshape_means(means, static_dim)[source]

Reshape means (T x D) to (T*num_windows x static_dim).

Parameters
Returns

Reshaped means (T*num_windows x static_dim). No-op if already reshaped.

Return type

numpy.ndarray

Examples

>>> from nnmnkwii import paramgen as G
>>> import numpy as np
>>> T, static_dim = 2, 2
>>> windows = [
...     (0, 0, np.array([1.0])),            # static
...     (1, 1, np.array([-0.5, 0.0, 0.5])), # delta
...     (1, 1, np.array([1.0, -2.0, 1.0])), # delta-delta
... ]
>>> means = np.random.rand(T, static_dim * len(windows))
>>> reshaped_means = G.reshape_means(means, static_dim)
>>> assert reshaped_means.shape == (T*len(windows), static_dim)