How to use the torchattacks.torchattacks.CW function in torchattacks

To help you get started, we’ve selected a few torchattacks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Harry24k / adversairal-attacks-pytorch / torchattacks / torchattacks.py View on Github external
def __init__(self, model, targeted=False, c=1e-4, kappa=0, iters=1000, lr=0.01):
        super(CW, self).__init__("CW", model)
        self.targeted = targeted
        self.c = c
        self.kappa = kappa
        self.iters = iters
        self.lr = lr