Spaces:
Build error
Build error
neverix
commited on
Commit
·
15409f2
1
Parent(s):
724a768
Improve optimization
Browse files- pulsar_clip.py +2 -1
pulsar_clip.py
CHANGED
|
@@ -93,7 +93,8 @@ class PulsarCLIP(object):
|
|
| 93 |
self.scheduler = torch.optim.lr_scheduler.CosineAnnealingWarmRestarts(self.optimizer,
|
| 94 |
int(self.args.iterations
|
| 95 |
/ self.args.augments
|
| 96 |
-
/ self.args.epochs)
|
|
|
|
| 97 |
import clip
|
| 98 |
self.txt_emb = self.model_clip.encode_text(clip.tokenize([self.args.text]).to(self.device))[0].detach()
|
| 99 |
self.txt_emb = torch.nn.functional.normalize(self.txt_emb, dim=-1)
|
|
|
|
| 93 |
self.scheduler = torch.optim.lr_scheduler.CosineAnnealingWarmRestarts(self.optimizer,
|
| 94 |
int(self.args.iterations
|
| 95 |
/ self.args.augments
|
| 96 |
+
/ self.args.epochs),
|
| 97 |
+
eta_min=args.lr / 100)
|
| 98 |
import clip
|
| 99 |
self.txt_emb = self.model_clip.encode_text(clip.tokenize([self.args.text]).to(self.device))[0].detach()
|
| 100 |
self.txt_emb = torch.nn.functional.normalize(self.txt_emb, dim=-1)
|