nnmnkwii.paramgen.mlpg_grad

nnmnkwii.paramgen.mlpg_grad(mean_frames, variance_frames, windows, grad_output)[source]

MLPG gradient computation

Parameters are same as nnmnkwii.paramgen.mlpg() except for grad_output. See the function docmenent for what the parameters mean.

Let \(d\) is the index of static features, \(l\) is the index of windows, gradients \(g_{d,l}\) can be computed by:

\[g_{d,l} = (\sum_{l} W_{l}^{T}P_{d,l}W_{l})^{-1} W_{l}^{T}P_{d,l}\]

where \(W_{l}\) is a banded window matrix and \(P_{d,l}\) is a diagonal precision matrix.

Assuming the variances are diagonals, MLPG can be performed in dimention-by-dimention efficiently.

Let \(o_{d}\) be T dimentional back-propagated gradients, the resulting gradients \(g'_{l,d}\) to be propagated are computed as follows:

\[g'_{d,l} = o_{d}^{T} g_{d,l}\]
Parameters
  • mean_frames (numpy.ndarray) – Means.

  • variance_frames (numpy.ndarray) – Variances.

  • windows (list) – Windows.

  • grad_output – Backpropagated output gradient, shape (T x static_dim)

Returns

Gradients to be back propagated, shape: (T x D)

Return type

numpy.ndarray