Skip to content

Conversation

@lucidrains
Copy link
Owner

@lucidrains lucidrains commented Oct 18, 2023

aim would be integrate with soundstream in https://github.com/lucidrains/audiolm-pytorch if there is a signal

@lucidrains lucidrains marked this pull request as draft October 18, 2023 16:01
@lucidrains lucidrains marked this pull request as ready for review October 20, 2023 18:33
@lucidrains
Copy link
Owner Author

works

import torch
from vector_quantize_pytorch import ResidualLFQ

residual_lfq = ResidualLFQ(
    dim = 256,
    codebook_size = 256,
    num_quantizers = 2
)

x = torch.randn(1, 1024, 256)

residual_lfq.eval()

quantized, indices, commit_loss = residual_lfq(x)

quantized_out = residual_lfq.get_codes_from_indices(indices) 

assert torch.all(quantized == residual_lfq.project_out(quantized_out.sum(dim = 0)))

@lucidrains lucidrains mentioned this pull request Oct 20, 2023
2 tasks
@lucidrains lucidrains merged commit cd4fd3f into master Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants