def isSafe(self, target): assert len(self.al) > 0 od, _ = torch.min(h.preDomRes(self.al[0], target).lb(), 1) for a in self.al[1:]: od1, _ = torch.min(h.preDomRes(a, target).lb(), 1) od = torch.min(od, od1) return od.gt(0.0).long()
def loss(self, target, **args): r = -h.preDomRes(self, target).lb() return F.softplus(r.max(1)[0])
def labels(self): target = torch.max(self.ub(), 1)[1] l = list(h.preDomRes(self, target).lb()[0]) return [target.item() ] + [i for i, v in zip(range(len(l)), l) if v <= 0]
def isSafe(self, target): od, _ = torch.min(h.preDomRes(self, target).lb(), 1) return od.gt(0.0).long()