MCPcopy Create free account
hub / github.com/ImprintLab/Medical-SAM2 / forward

Method forward

func_3d/function.py:28–31  ·  view source on GitHub ↗
(self, inputs, targets)

Source from the content-addressed store, hash-verified

26 self.focal_loss = FocalLoss(to_onehot_y=True, gamma=2.0)
27
28 def forward(self, inputs, targets):
29 dice = self.dice_loss(inputs, targets)
30 focal = self.focal_loss(inputs, targets)
31 return self.dice_weight * dice + self.focal_weight * focal
32
33
34GPUdevice = torch.device('cuda', args.gpu_device)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected