google-research / google-research/big_vision

Loss Scale for Training Siglip

Open
#115 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
3.5k
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Hi,

Thanks for your great work. I was trying to apply siglip loss for training contrastive models. However, I find the loss scale is quiet small, usually around 0.003 at the begging. I wonder if any thing goes wrong in my implementation.

```def sigclip_loss(logits):
n = logits.size(0)
labels = 2 * torch.eye(n) - torch.ones(n, n) # -1 with diagonal 1
labels = labels.to(logits.device)
loss = -torch.mean(F.logsigmoid(labels * logits)) / n
return loss```

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reviewing the posted sigclip_loss implementation and comparing its normalization and expected scale with the repository's SigLIP training path. Done should establish whether the reported loss is expected or identify the specific implementation issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.