Skip to content

Commit 9315776

Browse files
committed
address #227
1 parent 2b367e5 commit 9315776

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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.23.2"
3+
version = "1.23.3"
44
description = "Vector Quantization - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

vector_quantize_pytorch/vector_quantize_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ def calculate_ce_loss(codes):
12631263
# calculate codebook diversity loss (negative of entropy) if needed
12641264

12651265
if self.has_codebook_diversity_loss:
1266-
prob = (-distances * self.codebook_diversity_temperature).softmax(dim = -1)
1266+
prob = (distances * self.codebook_diversity_temperature).softmax(dim = -1)
12671267
avg_prob = reduce(prob, '... n l -> n l', 'mean')
12681268
codebook_diversity_loss = -entropy(avg_prob).mean()
12691269

0 commit comments

Comments
 (0)