nebula.addons.attacks.poisoning.labelflipping

nebula.addons.attacks.poisoning.labelflipping#

Functions#

labelFlipping(dataset, indices[, poisoned_persent, ...])

select flipping_persent of labels, and change them to random values.

Module Contents#

nebula.addons.attacks.poisoning.labelflipping.labelFlipping(dataset, indices, poisoned_persent=0, targeted=False, target_label=4, target_changed_label=7)#

select flipping_persent of labels, and change them to random values. :param dataset: the dataset of training data, torch.util.data.dataset like. :param indices: Indices of subsets, list like. :param flipping_persent: The ratio of labels want to change, float like.