vector-quantize-pytorch 1.22.4__tar.gz → 1.22.5__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.4 → vector_quantize_pytorch-1.22.5}/PKG-INFO +1 -1
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/pyproject.toml +1 -1
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/vector_quantize_pytorch.py +7 -3
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.github/workflows/build.yml +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.github/workflows/python-publish.yml +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.github/workflows/test.yml +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.gitignore +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/LICENSE +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/README.md +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder_fsq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/images/fsq.png +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/images/lfq.png +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/images/simvq.png +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/images/vq.png +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/ruff.toml +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/tests/test_latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/tests/test_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/tests/test_readme.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/__init__.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/finite_scalar_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/lookup_free_quantization.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/random_projection_quantizer.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/residual_fsq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/residual_lfq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/residual_sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/residual_vq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/sim_vq.py +0 -0
- {vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/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.5
|
|
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
|
|
@@ -138,11 +138,15 @@ def sample_multinomial(total_count, probs):
|
|
|
138
138
|
remainder = probs.new_ones(())
|
|
139
139
|
sample = torch.empty_like(probs, dtype = torch.long)
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
num_probs = len(probs)
|
|
142
|
+
|
|
143
|
+
for i, prob in enumerate(probs):
|
|
144
|
+
is_last = i == (num_probs - 1)
|
|
145
|
+
|
|
146
|
+
s = torch.binomial(total_count, prob / remainder) if not is_last else total_count
|
|
143
147
|
sample[i] = s
|
|
144
148
|
total_count -= s
|
|
145
|
-
remainder -=
|
|
149
|
+
remainder -= prob
|
|
146
150
|
|
|
147
151
|
assert total_count == 0, f'invalid total count {total_count}'
|
|
148
152
|
|
{vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.github/workflows/build.yml
RENAMED
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/.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.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder_fsq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/examples/autoencoder_lfq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/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.4 → vector_quantize_pytorch-1.22.5}/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.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/sim_vq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.22.4 → vector_quantize_pytorch-1.22.5}/vector_quantize_pytorch/utils.py
RENAMED
|
File without changes
|