mlpg#

diffsptk.MLPG#

alias of MaximumLikelihoodParameterGeneration

class diffsptk.MaximumLikelihoodParameterGeneration(size: int, seed: list[list[float] | tuple[float, ...] | ndarray] | tuple[list[float] | tuple[float, ...] | ndarray, ...] | ndarray | list[int] | tuple[int, ...] = [[-0.5, 0, 0.5], [1, -2, 1]])[source]#

See this page for details. Currently, only global unit variance is supported.

Parameters:
sizeint >= 1

The length of the input sequence, \(T\).

seedlist[list[float]] or list[int]

The delta coefficients or the width(s) of 1st (and 2nd) regression coefficients.

forward(u: Tensor) Tensor[source]#

Perform MLPG given the mean vectors with delta components.

Parameters:
uTensor [shape=(…, T, DxH)]

The time-variant mean vectors with delta components.

Returns:
outTensor [shape=(…, T, D)]

The smoothed static components.

Examples

>>> x = diffsptk.ramp(1, 8).view(1, -1, 2)
>>> x
tensor([[[1., 2.],
         [3., 4.],
         [5., 6.],
         [7., 8.]]])
>>> delta = diffsptk.Delta([[-0.5, 0], [0, 0, 0.5]])
>>> y = delta(x)
>>> y
tensor([[[ 1.0000,  2.0000, -0.5000, -1.0000,  1.5000,  2.0000],
         [ 3.0000,  4.0000, -0.5000, -1.0000,  2.5000,  3.0000],
         [ 5.0000,  6.0000, -1.5000, -2.0000,  3.5000,  4.0000],
         [ 7.0000,  8.0000, -2.5000, -3.0000,  3.5000,  4.0000]]])
>>> mlpg = diffsptk.MLPG(y.size(1), [[-0.5, 0], [0, 0, 0.5]])
>>> c = mlpg(y)
>>> c
tensor([[[1., 2.],
         [3., 4.],
         [5., 6.],
         [7., 8.]]])
diffsptk.functional.mlpg(u: Tensor, seed: list[list[float] | tuple[float, ...] | ndarray] | tuple[list[float] | tuple[float, ...] | ndarray, ...] | ndarray | list[int] | tuple[int, ...] = [[-0.5, 0, 0.5], [1, -2, 1]]) Tensor[source]#

Perform MLPG given the mean vectors with delta components.

Parameters:
uTensor [shape=(…, T, DxH)]

The time-variant mean vectors with delta components.

seedlist[list[float]] or list[int]

The delta coefficients or the width(s) of 1st (and 2nd) regression coefficients.

Returns:
outTensor [shape=(…, T, D)]

The smoothed static components.

See also

delta