def get_triplets(self, anom_idx, x, y, normal_label=0):
    self.x = x.cpu().data.numpy()
    self.y = y.cpu().data.numpy()
    noml_idx = np.where((self.y == normal_label))[0]
    nbr_indices = self.nbr_indices
    rand_num = self.rand_num
    rand_canddt = np.setdiff1d(noml_idx, nbr_indices)
    rand_indices = np.random.choice(rand_canddt, rand_num, replace=False)
    triplets = [[anchor, positive, anom_idx] for anchor in rand_indices for positive in nbr_indices]
    return torch.LongTensor(np.array(triplets))
def get_triplets(self, anom_idx, x, y, normal_label=0):
    self.x = x.cpu().data.numpy()
    self.y = y.cpu().data.numpy()
    noml_idx = np.where((self.y == normal_label))[0]
    nbr_indices = self.nbr_indices
    rand_num = self.rand_num
    rand_canddt = np.setdiff1d(noml_idx, nbr_indices)
    rand_indices = np.random.choice(rand_canddt, rand_num, replace=False)
    triplets = [[anchor, positive, anom_idx] for anchor in rand_indices for positive in nbr_indices]
    return torch.LongTensor(np.array(triplets))