vector-quantize-pytorch 1.22.3__tar.gz → 1.22.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/PKG-INFO +1 -1
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/pyproject.toml +1 -1
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/vector_quantize_pytorch.py +22 -4
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.github/workflows/build.yml +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.github/workflows/python-publish.yml +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.github/workflows/test.yml +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.gitignore +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/LICENSE +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/README.md +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_fsq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/images/fsq.png +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/images/lfq.png +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/images/simvq.png +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/images/vq.png +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/ruff.toml +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/tests/test_latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/tests/test_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/tests/test_readme.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/__init__.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/finite_scalar_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/lookup_free_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/random_projection_quantizer.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/residual_fsq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/residual_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/residual_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/residual_vq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vector-quantize-pytorch
|
|
3
|
-
Version: 1.22.
|
|
3
|
+
Version: 1.22.4
|
|
4
4
|
Summary: Vector Quantization - Pytorch
|
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/vector-quantize-pytorch/
|
|
6
6
|
Project-URL: Repository, https://github.com/lucidrains/vector-quantizer-pytorch
|
|
@@ -559,9 +559,18 @@ class EuclideanCodebook(Module):
|
|
|
559
559
|
|
|
560
560
|
else:
|
|
561
561
|
if exists(codebook_transform_fn):
|
|
562
|
-
quantize = einx.get_at('h b n [c] d, h b n -> h b n d', transformed_embed, embed_ind)
|
|
562
|
+
# quantize = einx.get_at('h b n [c] d, h b n -> h b n d', transformed_embed, embed_ind)
|
|
563
|
+
|
|
564
|
+
repeated_embed_ind = repeat(embed_ind, 'h b n -> h b n 1 d', d = transformed_embed.shape[-1])
|
|
565
|
+
quantize = transformed_embed.gather(-2, repeated_embed_ind)
|
|
566
|
+
quantize = rearrange(quantize, 'h b n 1 d -> h b n d')
|
|
567
|
+
|
|
563
568
|
else:
|
|
564
|
-
quantize = einx.get_at('h [c] d, h b n -> h b n d', embed, embed_ind)
|
|
569
|
+
# quantize = einx.get_at('h [c] d, h b n -> h b n d', embed, embed_ind)
|
|
570
|
+
|
|
571
|
+
repeated_embed = repeat(embed, 'h c d -> h b c d', b = embed_ind.shape[1])
|
|
572
|
+
repeated_embed_ind = repeat(embed_ind, 'h b n -> h b n d', d = embed.shape[-1])
|
|
573
|
+
quantize = repeated_embed.gather(-2, repeated_embed_ind)
|
|
565
574
|
|
|
566
575
|
if self.training and self.ema_update and not freeze_codebook:
|
|
567
576
|
|
|
@@ -767,9 +776,18 @@ class CosineSimCodebook(Module):
|
|
|
767
776
|
|
|
768
777
|
else:
|
|
769
778
|
if exists(codebook_transform_fn):
|
|
770
|
-
quantize = einx.get_at('h b n [c] d, h b n -> h b n d', transformed_embed, embed_ind)
|
|
779
|
+
# quantize = einx.get_at('h b n [c] d, h b n -> h b n d', transformed_embed, embed_ind)
|
|
780
|
+
|
|
781
|
+
repeated_embed_ind = repeat(embed_ind, 'h b n -> h b n 1 d', d = transformed_embed.shape[-1])
|
|
782
|
+
quantize = transformed_embed.gather(-2, repeated_embed_ind)
|
|
783
|
+
quantize = rearrange(quantize, 'h b n 1 d -> h b n d')
|
|
784
|
+
|
|
771
785
|
else:
|
|
772
|
-
quantize = einx.get_at('h [c] d, h b n -> h b n d', embed, embed_ind)
|
|
786
|
+
# quantize = einx.get_at('h [c] d, h b n -> h b n d', embed, embed_ind)
|
|
787
|
+
|
|
788
|
+
repeated_embed = repeat(embed, 'h c d -> h b c d', b = embed_ind.shape[1])
|
|
789
|
+
repeated_embed_ind = repeat(embed_ind, 'h b n -> h b n d', d = embed.shape[-1])
|
|
790
|
+
quantize = repeated_embed.gather(-2, repeated_embed_ind)
|
|
773
791
|
|
|
774
792
|
if self.training and self.ema_update and not freeze_codebook:
|
|
775
793
|
if exists(mask):
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.github/workflows/build.yml
RENAMED
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/.github/workflows/test.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_fsq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_lfq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/examples/autoencoder_sim_vq.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/tests/test_latent_quantization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/sim_vq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.3 → vector_quantize_pytorch-1.22.4}/vector_quantize_pytorch/utils.py
RENAMED
|
File without changes
|