Skip to content

Commit 1155588

Browse files
committed
readme
1 parent e017dd4 commit 1155588

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,11 @@ assert torch.all(quantized == quantized_out)
421421
```
422422

423423
### Latent Quantization
424+
424425
Disentanglement is essential for representation learning as it promotes interpretability, generalization, improved learning, and robustness. It aligns with the goal of capturing meaningful and independent features of the data, facilitating more effective use of learned representations across various applications. For better disentanglement, the challenge is to disentangle underlying variations in a dataset without explicit ground truth information. This work introduces a key inductive bias aimed at encoding and decoding within an organized latent space. The strategy incorporated encompasses discretizing the latent space by assigning discrete code vectors through the utilization of an individual learnable scalar codebook for each dimension. This methodology enables their models to surpass robust prior methods effectively.
425426

427+
Be aware they had to use a very high weight decay for the results in this paper.
428+
426429
```python
427430
import torch
428431
from vector_quantize_pytorch import LatentQuantize
@@ -472,9 +475,12 @@ from vector_quantize_pytorch import LatentQuantize
472475
levels = [4, 8, 16]
473476
dim = 9
474477
num_codebooks = 3
478+
475479
model = LatentQuantize(levels, dim, num_codebooks=num_codebooks)
480+
476481
input_tensor = torch.randn(2, 3, dim)
477482
output_tensor, indices, loss = model(input_tensor)
483+
478484
assert output_tensor.shape == input_tensor.shape
479485
assert indices.shape == (2, 3, num_codebooks)
480486
assert loss.item() >= 0
@@ -630,13 +636,14 @@ assert loss.item() >= 0
630636
primaryClass = {cs.CV}
631637
}
632638
```
639+
633640
```bibtex
634641
@misc{hsu2023disentanglement,
635-
title={Disentanglement via Latent Quantization},
636-
author={Kyle Hsu and Will Dorrell and James C. R. Whittington and Jiajun Wu and Chelsea Finn},
637-
year={2023},
638-
eprint={2305.18378},
639-
archivePrefix={arXiv},
640-
primaryClass={cs.LG}
642+
title = {Disentanglement via Latent Quantization},
643+
author = {Kyle Hsu and Will Dorrell and James C. R. Whittington and Jiajun Wu and Chelsea Finn},
644+
year = {2023},
645+
eprint = {2305.18378},
646+
archivePrefix = {arXiv},
647+
primaryClass = {cs.LG}
641648
}
642649
```

0 commit comments

Comments
 (0)