Skip to content

Commit 681709c

Browse files
committed
bug fix: commitment loss factor beta
1 parent 8549d3a commit 681709c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

taming/modules/vqvae/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def forward(self, z):
6666
# ......\end......... (TODO)
6767

6868
# compute loss for embedding
69-
loss = torch.mean((z_q.detach()-z)**2) + self.beta * \
69+
loss = self.beta * torch.mean((z_q.detach()-z)**2) + \
7070
torch.mean((z_q - z.detach()) ** 2)
7171

7272
# preserve gradients

0 commit comments

Comments
 (0)