vector-quantize-pytorch 1.24.0__tar.gz → 1.24.2__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.24.0 → vector_quantize_pytorch-1.24.2}/PKG-INFO +1 -1
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/pyproject.toml +1 -1
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/vector_quantize_pytorch.py +6 -1
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.github/workflows/build.yml +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.github/workflows/python-publish.yml +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.github/workflows/test.yml +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.gitignore +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/LICENSE +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/README.md +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder_fsq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder_lfq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/images/fsq.png +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/images/lfq.png +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/images/simvq.png +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/images/vq.png +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/ruff.toml +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/tests/test_latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/tests/test_lfq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/tests/test_readme.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/__init__.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/finite_scalar_quantization.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/lookup_free_quantization.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/random_projection_quantizer.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/residual_fsq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/residual_lfq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/residual_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/residual_vq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/sim_vq.py +0 -0
- {vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/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.24.
|
|
3
|
+
Version: 1.24.2
|
|
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
|
|
@@ -271,7 +271,7 @@ def kmeans(
|
|
|
271
271
|
# straight through
|
|
272
272
|
|
|
273
273
|
def straight_through(src, tgt):
|
|
274
|
-
return src + (tgt
|
|
274
|
+
return src + (tgt - src).detach()
|
|
275
275
|
|
|
276
276
|
# rotation trick related
|
|
277
277
|
|
|
@@ -572,8 +572,11 @@ class EuclideanCodebook(Module):
|
|
|
572
572
|
self.update_affine(flatten, self.embed, mask = mask)
|
|
573
573
|
|
|
574
574
|
# get maybe learnable codes
|
|
575
|
+
|
|
575
576
|
embed = self.embed if self.learnable_codebook else self.embed.detach()
|
|
576
577
|
|
|
578
|
+
embed = embed.to(dtype)
|
|
579
|
+
|
|
577
580
|
# affine params
|
|
578
581
|
if self.affine_param:
|
|
579
582
|
codebook_std = self.codebook_variance.clamp(min = 1e-5).sqrt()
|
|
@@ -808,6 +811,8 @@ class CosineSimCodebook(Module):
|
|
|
808
811
|
|
|
809
812
|
embed = self.embed if self.learnable_codebook else self.embed.detach()
|
|
810
813
|
|
|
814
|
+
embed = embed.to(dtype)
|
|
815
|
+
|
|
811
816
|
# handle maybe implicit neural codebook
|
|
812
817
|
# and compute cosine sim distance
|
|
813
818
|
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.github/workflows/build.yml
RENAMED
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/.github/workflows/test.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder_fsq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/examples/autoencoder_lfq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/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.24.0 → vector_quantize_pytorch-1.24.2}/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.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/sim_vq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.24.0 → vector_quantize_pytorch-1.24.2}/vector_quantize_pytorch/utils.py
RENAMED
|
File without changes
|