From 4d3da00bfde2b83c5e64bc1e046b7e3908d0846e Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Sun, 14 Feb 2021 18:37:35 -0800 Subject: [PATCH] fix a bug thanks to @almsley --- big_sleep/big_sleep.py | 3 ++- big_sleep/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/big_sleep/big_sleep.py b/big_sleep/big_sleep.py index 84f4692..424dcb1 100644 --- a/big_sleep/big_sleep.py +++ b/big_sleep/big_sleep.py @@ -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() diff --git a/big_sleep/version.py b/big_sleep/version.py index 2b8877c..93b60a1 100644 --- a/big_sleep/version.py +++ b/big_sleep/version.py @@ -1 +1 @@ -__version__ = '0.5.0' +__version__ = '0.5.1'