Skip to content

Get Started

Beat Buesser edited this page Aug 25, 2021 · 10 revisions

Setup

Installation with pip

ART is designed and tested to run with Python 3.

ART and its core dependencies (excluding frameworks, e.g. TensorFlow, and tool specific dependencies, these have to be installed separately or with the install options below) can be installed from the PyPI repository using pip:

pip install adversarial-robustness-toolbox

ART provides the following install options (option_name: target):

  • docs: Documentation
  • catboost: CatBoost
  • gpy: GPy
  • keras: Keras
  • lightgbm: LightGBM
  • mxnet: MXNet
  • tensorflow: TensorFlow
  • tensorflow_image: TensorFlow + image/video
  • tensorflow_audio: TensorFlow + audio
  • pytorch: PyTorch
  • pytorch_image: PyTorch + image/video
  • pytorch_audio: PyTorch + audio
  • xgboost: XGBboost
  • lingvo_asr: Lingvo ASR
  • all: all dependencies
  • non_framework: all non-framework dependencies

to be used with:

pip install adversarial-robustness-toolbox[option_name]

Manual installation

The most recent version of ART can be downloaded or cloned from this repository:

git clone https://github.com/Trusted-AI/adversarial-robustness-toolbox

Install ART with the following command from the project folder adversarial-robustness-toolbox:

Using pip:

pip install .

Docker:

  • Build the ART docker image: make build
  • To enter the ART docker environment run: make run-bash
  • To run the Jupyter notebooks from the container run make run-jupyter and copy and paste the url generated
    to connect to that container.

ART Unit tests

ART provides unit tests that can be ran within the ART environment. The first time the tests are ran, ART will download the necessary datasets so it might take a while to do so.

Use the following commands to run the tests:

Using pip:

bash run_tests.sh

Using Docker: make run-test

Getting Started with ART

Examples of using ART can be found in examples and examples/README.md provides an overview and additional information. It contains a minimal example for each machine learning framework. All examples can be run with the following command:

python examples/<example_name>.py

More detailed examples and tutorials are located in notebooks and notebooks/README.md provides and overview and more information.