You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vector_quantize_pytorch/vector_quantize_pytorch.py
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -592,15 +592,18 @@ def forward(
592
592
ifself.orthogonal_reg_weight>0:
593
593
codebook=self._codebook.embed
594
594
595
+
# only calculate orthogonal loss for the activated codes for this batch
596
+
595
597
ifself.orthogonal_reg_active_codes_only:
596
-
# only calculate orthogonal loss for the activated codes for this batch
598
+
assertnot (is_multiheadedandself.separate_codebook_per_head), 'orthogonal regularization for only active codes not compatible with multi-headed with separate codebooks yet'
0 commit comments