예제 #1
0
 def accumulate(self, learn):
     pred, targ = flatten_check(torch.sigmoid(learn.pred), learn.y)
     for i, th in enumerate(self.ths):
         p = (pred > th).float()
         self.inter[i] += (p * targ).float().sum().item()
         self.union[i] += (p + targ).float().sum().item()
예제 #2
0
 def accumulate(self, learn):
     pred, targ = flatten_check(torch.sigmoid(learn.pred), learn.y)
     self.inter += (pred * targ).float().sum().item()
     self.union += (pred + targ).float().sum().item()