Skip to content

Commit

Permalink
fix a bug thanks to @almsley
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Feb 15, 2021
1 parent 3531538 commit 4d3da00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion big_sleep/big_sleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def forward(self, text_embed, return_loss = True):
skews = torch.mean(torch.pow(zscores, 3.0))
kurtoses = torch.mean(torch.pow(zscores, 4.0)) - 3.0

lat_loss = lat_loss + torch.abs(kurtoses) / num_latents + torch.abs(skews) / num_latents
lat_loss = lat_loss + torch.abs(kurtoses) / num_latents + torch.abs(skews) / num_latents

cls_loss = ((50 * torch.topk(soft_one_hot_classes, largest = False, dim = 1, k = 999)[0]) ** 2).mean()

sim_loss = -self.loss_coef * torch.cosine_similarity(text_embed, image_embed, dim = -1).mean()
Expand Down
2 changes: 1 addition & 1 deletion big_sleep/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.0'
__version__ = '0.5.1'

0 comments on commit 4d3da00

Please sign in to comment.