Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayunhan committed Jun 4, 2019
1 parent c96b82f commit d293cf8
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 433 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/
*.h5

# test code
notebook.ipynb
perceptron/tmp/
perceptron/utils/images/porn.jpeg

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include perceptron/utils/images/*.png
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Currently, you can use Perceptron either through its python API or its command l

## Getting Started

### Installation
The `PyTorch` and `Tensorflow` packages are required if you want to test their models, we requir user to manually install them on demand. Otherwise, run the following command to install Perceptron Benchmark
```
pip install -e .
```

### Running Examples via Command Lines
In the docker shell, run the test through Perceptron command line interface
```bash
Expand Down
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.autodoc',
'numpydoc',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
Expand Down
76 changes: 2 additions & 74 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.
Welcome to Perceptron Robustness Benchmark's page!
=======================================
==================================================

Perceptron is a benchmark to test safety and security properties of neural
networks for perceptual tasks.
Expand All @@ -15,7 +15,7 @@ It comes with support for many frameworks to build models including
* PyTorch
* Keras
* Cloud API
* PaddlePaddle (In progress)
* PaddlePaddle

See currently supported evaluation metrics, models, adversarial criteria,
and verification methods in :doc:`user/summary`.
Expand Down Expand Up @@ -49,78 +49,6 @@ toolbox such as :code:`cleverhans`, :code:`foolbox`, :code:`IBM ART`,
- Gives :red:`verifiable` robustness bounds for security and safety
properties.

More specifically, we compare :code:`perceptron` with existing DNN benchmarks
in the following table:

.. list-table:: :shade:`DNN Benchmarks Comparison`
:widths: 50 24 24 24 24
:header-rows: 1

* - Properties
- Perceptron
- Cleverhans
- Foolbox
- IBM ART
* - Multi-platform support
- :math:`\checkmark`
- :math:`\checkmark`
- :math:`\checkmark`
- :math:`\checkmark`
* - Consistent API design
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Custom adversarial criteria
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Multiple perceptual tasks
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\cdot`
- :math:`\cdot`
* - Standardized metrics
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Verifiable robustness bounds
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\cdot`
- :math:`\cdot`

Explanation of compared properties:

- :blue:`Multi-platform support`: supports at least the
three deep learning frameworks, :code:`Tensoflow`,
:code:`PyTorch`, and :code:`Keras`.

- :blue:`Consistent API design`: implementations of evaluation methods
are platform-agnostic. More specifically, the same piece of code for
an evaluation method (e.g., a :code:`C&W` attack) can run against
models across all platforms (e.g., :code:`Tensorflow`,
:code:`PyTorch`, and :code:`cloud API`).

- :blue:`Custom adversarial criterion`: a criterion defines under what
circumstances an :code:`(input, label)` pair is considered an adversary.
Customized adversarial criteria other than :code:`misclassification`
should be supported.

- :blue:`Multiple perceptual tasks`: supports computer vision tasks other
than :code:`classification`, e.g., :code:`object detection` and
:code:`face recognition`.

- :blue:`Standardized metrics`: enables DNN models' robustness to be
comparable on all **security** and **safety** properties.

- :blue:`Verifiable robustness bounds`: supports verification of certain
safety properties. Returns either a verifiable bound, indicating that the
model is robust against perturbations within that bound, or return
counter-examples.

Running benchmarks
==================

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
352 changes: 0 additions & 352 deletions notebook.ipynb

This file was deleted.

2 changes: 1 addition & 1 deletion perceptron/models/classification/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(


class AipAntiPornModel(AipModel):
"""Create a :class: `Model` instance from an `AipAntiPorn` model.
"""Create a :class:`Model` instance from an `AipAntiPorn` model.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion perceptron/models/classification/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


class KerasModel(DifferentiableModel):
"""Create a :class: `Model` instance from a `Keras` model.
"""Create a :class:`Model` instance from a `Keras` model.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion perceptron/models/detection/keras_retina_resnet50.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


class KerasResNet50RetinaNetModel(DifferentiableModel):
"""Create a :class: `Model` instance from a `DifferentiableModel` model.
"""Create a :class:`Model` instance from a `DifferentiableModel` model.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion perceptron/models/detection/keras_ssd300.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


class KerasSSD300Model(DifferentiableModel):
"""Create a :class: `Model` instance from a `DifferentiableModel` model.
"""Create a :class:`Model` instance from a `DifferentiableModel` model.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion perceptron/models/detection/keras_yolov3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


class KerasYOLOv3Model(DifferentiableModel):
"""Create a :class: `Model` instance from a `Keras` model.
"""Create a :class:`Model` instance from a `Keras` model.
Parameters
----------
Expand Down
19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
from setuptools import setup
from setuptools import find_packages

requirements = [
'numpy',
'matplotlib',
'urllib3',
'tqdm',
'pillow',
'scipy',
'sphinx',
'sphinx_rtd_theme'
]

setup(
name='perceptron',
version='0.1.0.dev',
packages=find_packages()
description='Robustness benchmark for deep learning models',
version='1.0.0.dev',
url="https://github.com/baidu-advbox/perceptron-benchmark",
packages=find_packages(),
include_package_data=True,
install_requires=requirements
)

0 comments on commit d293cf8

Please sign in to comment.