nnmnkwii.paramgen.unit_variance_mlpg_matrix

nnmnkwii.paramgen.unit_variance_mlpg_matrix(windows, T)[source]

Compute MLPG matrix assuming input is normalized to have unit-variances.

Let \(\mu\) is the input mean sequence (num_windows*T x static_dim), \(W\) is a window matrix (T x num_windows*T), assuming input is normalized to have unit-variances, MLPG can be written as follows:

\[y = R \mu\]

where

\[R = (W^{T} W)^{-1} W^{T}\]

Here we call \(R\) as the MLPG matrix.

Parameters
  • windows – (list): List of windows.

  • T (int) – Number of frames.

Returns

MLPG matrix (T x nun_windows*T).

Return type

numpy.ndarray

Examples

>>> from nnmnkwii import paramgen as G
>>> import numpy as np
>>> windows = [
...         (0, 0, np.array([1.0])),
...         (1, 1, np.array([-0.5, 0.0, 0.5])),
...         (1, 1, np.array([1.0, -2.0, 1.0])),
...     ]
>>> G.unit_variance_mlpg_matrix(windows, 3)
array([[  2.73835927e-01,   1.95121944e-01,   9.20177400e-02,
          9.75609720e-02,  -9.09090936e-02,  -9.75609720e-02,
         -3.52549881e-01,  -2.43902430e-02,   1.10864742e-02],
       [  1.95121944e-01,   3.41463417e-01,   1.95121944e-01,
          1.70731708e-01,  -5.55111512e-17,  -1.70731708e-01,
         -4.87804860e-02,  -2.92682916e-01,  -4.87804860e-02],
       [  9.20177400e-02,   1.95121944e-01,   2.73835927e-01,
          9.75609720e-02,   9.09090936e-02,  -9.75609720e-02,
          1.10864742e-02,  -2.43902430e-02,  -3.52549881e-01]], dtype=float32)