Correctly initializing the logit scale parameter

cf. #46
This commit is contained in:
Jong Wook Kim 2021-03-22 18:07:08 -04:00 committed by GitHub
parent beba48f353
commit 43c953e231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,7 @@ class CLIP(nn.Module):
self.ln_final = LayerNorm(transformer_width)
self.text_projection = nn.Parameter(torch.empty(transformer_width, embed_dim))
self.logit_scale = nn.Parameter(torch.ones([]))
self.logit_scale = nn.Parameter(torch.FloatTensor([np.log(1/0.07)]))
self.initialize_parameters()