Skip to content

Commit 089011b

Browse files
committed
release the rotation trick for VQ from @cfifty https://arxiv.org/abs/2410.06424
1 parent d3dd5e5 commit 089011b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

examples/autoencoder.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def iterate_dataset(data_loader):
8888

8989
print("baseline")
9090
torch.random.manual_seed(seed)
91-
model = SimpleVQAutoEncoder(codebook_size=num_codes).to(device)
91+
92+
model = SimpleVQAutoEncoder(
93+
codebook_size=num_codes,
94+
rotation_trick=True
95+
).to(device)
96+
9297
opt = torch.optim.AdamW(model.parameters(), lr=lr)
9398
train(model, train_dataset, train_iterations=train_iter)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vector-quantize-pytorch"
3-
version = "1.17.8"
3+
version = "1.18.0"
44
description = "Vector Quantization - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

0 commit comments

Comments
 (0)