ivq#

class diffsptk.InverseVectorQuantization[source]#

See this page for details.

References

[1]

A. v. d. Oord et al., “Neural discrete representation learning,” Advances in Neural Information Processing Systems, pp. 6309-6318, 2017.

forward(indices: Tensor, codebook: Tensor) Tensor[source]#

Perform inverse vector quantization.

Parameters:
indicesTensor [shape=(…,)]

The codebook indices.

codebookTensor [shape=(K, M+1)]

The codebook.

Returns:
xqTensor [shape=(…, M+1)]

The quantized vectors.

Examples

>>> import diffsptk
>>> vq = diffsptk.VectorQuantization(4, 3)
>>> ivq = diffsptk.InverseVectorQuantization()
>>> indices = torch.tensor([0, 1, 2, 1])
>>> xq = ivq(indices, vq.codebook)
>>> xq.shape
torch.Size([4, 5])

See also

vq lbg