delta#
- class diffsptk.Delta(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]], static_out: bool = True)[source]#
See this page for details.
- Parameters:
- seedlist[list[float]] or list[int]
The delta coefficients or the width(s) of 1st (and 2nd) regression coefficients.
- static_outbool
If False, outputs only the delta components.
- forward(x: Tensor) Tensor [source]#
Compute the delta components.
- Parameters:
- xTensor [shape=(B, T, D) or (T, D)]
The static components.
- Returns:
- outTensor [shape=(B, T, DxH) or (T, DxH)]
The delta (and 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]]])
- diffsptk.functional.delta(x: Tensor, seed: list[list[float] | tuple[float, ...] | ndarray] | tuple[list[float] | tuple[float, ...] | ndarray, ...] | ndarray | list[int] | tuple[int, ...] = [[-0.5, 0, 0.5]], static_out: bool = True) Tensor [source]#
Compute the delta components.
- Parameters:
- xTensor [shape=(B, T, D) or (T, D)]
The static components.
- seedlist[list[float]] or list[int]
The delta coefficients or the width(s) of 1st (and 2nd) regression coefficients.
- static_outbool
If False, outputs only the delta components.
- Returns:
- outTensor [shape=(B, T, DxH) or (T, DxH)]
The delta (and static) components.
See also