Skip to main content

Attax: adversarial attacks using JAX

Project description

Attax is python library with implementations of some common adversarial attacks using JAX. For now this is a prototype at best and I refer you my other project, Foolbox, that also supports JAX and provides a well-tested suite of adversarial attacks.


pip install attax


import attax
from functools import partial

def predict(params, inputs):
    # see
    # ...

params = ...  # model parameters
x = ...  # input data
y = ...  # labels

f = partial(predict, params)

x_adv = attax.pgd(f, x, y, epsilon=0.3)

print((f(x).argmax(axis=-1) == y).mean())
print((f(x_adv).argmax(axis=-1) == y).mean())

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for attax, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size attax-0.0.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page