MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / forward

Method forward

loss.py:144–151  ·  view source on GitHub ↗
(self, preds, gt)

Source from the content-addressed store, hash-verified

142 }
143
144 def forward(self, preds, gt):
145 loss = 0.
146 for _, pred_lvl in enumerate(preds):
147 if pred_lvl is None:
148 continue
149 for criterion_name, criterion in self.criterions_last.items():
150 loss += criterion(pred_lvl, gt) * self.lambdas_cls[criterion_name]
151 return loss
152
153
154class PixLoss(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected