Skip to content

Commit e2d7608

Browse files
committed
disallow cosine sim dist + learnable codebook
1 parent db4b48a commit e2d7608

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vector-quantize-pytorch"
3-
version = "1.22.0"
3+
version = "1.22.1"
44
description = "Vector Quantization - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "lucidrains@gmail.com" }

vector_quantize_pytorch/vector_quantize_pytorch.py

+1
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ def __init__(
873873
self.commitment_weight = commitment_weight
874874
self.commitment_use_cross_entropy_loss = commitment_use_cross_entropy_loss # whether to use cross entropy loss to codebook as commitment loss
875875

876+
assert not (use_cosine_sim and learnable_codebook), 'cosine sim distance codebook not compatible with learnable codebook yet'
876877
self.learnable_codebook = learnable_codebook
877878

878879
has_codebook_orthogonal_loss = orthogonal_reg_weight > 0.

0 commit comments

Comments
 (0)