Skip to main content

Attax: adversarial attacks using JAX

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.

Installation

pip install attax

Example

import attax
from functools import partial

def predict(params, inputs):
    # see https://github.com/google/jax
    # ...

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())

Metadata

Release files for attax 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attax 0.0.2
File Size Uploaded Provenance Actions
attax-0.0.2.tar.gz 2.6 kB Without provenance Details for attax-0.0.2.tar.gz

Release files / attax-0.0.2.tar.gz

Download URL attax-0.0.2.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
558fdbe91b9bd0029a59f449c31e0258c06dfc8540cf75678e8d47fd799c9b42
BLAKE2b-256 checksum
How to use checksums
50d6799f34fc7d23d4a6fe406ccfb2d3c1868ad647bc47f646f23d3b50df9d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Security for attax 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page