Skip to content

Commit

Permalink
Merge pull request #386 from jonasrauber/batch_default
Browse files Browse the repository at this point in the history
change foolbox.attacks to point to batch attacks, introduce foolbox.v1
  • Loading branch information
jonasrauber authored Oct 23, 2019
2 parents 82d79a7 + 7806c6f commit 4d6d7c1
Show file tree
Hide file tree
Showing 128 changed files with 2,578 additions and 2,228 deletions.
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ The source code and a `minimal working example`_ can be found on `GitHub`_.
modules/attacks
modules/adversarial
modules/utils
modules/v1_attacks
modules/v1_adversarial

Indices and tables
==================
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/v1_adversarial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`foolbox.v1.adversarial`
====================================

.. automodule:: foolbox.v1.adversarial

.. autoclass:: Adversarial
:members:
97 changes: 97 additions & 0 deletions docs/modules/v1_attacks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
:mod:`foolbox.v1.attacks`
================================

.. automodule:: foolbox.v1.attacks

.. toctree::
:hidden:

v1_attacks/gradient
v1_attacks/score
v1_attacks/decision
v1_attacks/other


.. rubric:: :doc:`v1_attacks/gradient`

.. autosummary::
:nosignatures:

GradientAttack
GradientSignAttack
FGSM
LinfinityBasicIterativeAttack
BasicIterativeMethod
BIM
L1BasicIterativeAttack
L2BasicIterativeAttack
ProjectedGradientDescentAttack
ProjectedGradientDescent
PGD
RandomStartProjectedGradientDescentAttack
RandomProjectedGradientDescent
RandomPGD
AdamL1BasicIterativeAttack
AdamL2BasicIterativeAttack
AdamProjectedGradientDescentAttack
AdamProjectedGradientDescent
AdamPGD
AdamRandomStartProjectedGradientDescentAttack
AdamRandomProjectedGradientDescent
AdamRandomPGD
MomentumIterativeAttack
MomentumIterativeMethod
LBFGSAttack
DeepFoolAttack
NewtonFoolAttack
DeepFoolL2Attack
DeepFoolLinfinityAttack
ADefAttack
SLSQPAttack
SaliencyMapAttack
IterativeGradientAttack
IterativeGradientSignAttack
CarliniWagnerL2Attack
EADAttack
DecoupledDirectionNormL2Attack
SparseFoolAttack
SparseL1BasicIterativeAttack
VirtualAdversarialAttack

.. rubric:: :doc:`v1_attacks/score`

.. autosummary::
:nosignatures:

SinglePixelAttack
LocalSearchAttack
ApproximateLBFGSAttack


.. rubric:: :doc:`v1_attacks/decision`

.. autosummary::
:nosignatures:

BoundaryAttack
SpatialAttack
PointwiseAttack
GaussianBlurAttack
ContrastReductionAttack
AdditiveUniformNoiseAttack
AdditiveGaussianNoiseAttack
SaltAndPepperNoiseAttack
BlendedUniformNoiseAttack
BoundaryAttackPlusPlus
GenAttack
HopSkipJumpAttack


.. rubric:: :doc:`v1_attacks/other`

.. autosummary::
:nosignatures:

BinarizationRefinementAttack
PrecomputedAdversarialsAttack
InversionAttack
50 changes: 50 additions & 0 deletions docs/modules/v1_attacks/decision.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Decision-based attacks
-----------------

.. currentmodule:: foolbox.attacks

.. autoclass:: BoundaryAttack
:members:
:special-members:

.. autoclass:: SpatialAttack
:members:
:special-members:

.. autoclass:: PointwiseAttack
:members:
:special-members:

.. autoclass:: GaussianBlurAttack
:members:
:special-members:

.. autoclass:: ContrastReductionAttack
:members:
:special-members:

.. autoclass:: AdditiveUniformNoiseAttack
:members:
:special-members:
:inherited-members:

.. autoclass:: AdditiveGaussianNoiseAttack
:members:
:special-members:
:inherited-members:

.. autoclass:: SaltAndPepperNoiseAttack
:members:
:special-members:

.. autoclass:: BlendedUniformNoiseAttack
:members:
:special-members:

.. autoclass:: HopSkipJumpAttack
:members:
:special-members:

.. autoclass:: GenAttack
:members:
:special-members:
164 changes: 164 additions & 0 deletions docs/modules/v1_attacks/gradient.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
Gradient-based attacks
----------------------

.. currentmodule:: foolbox.attacks

.. autoclass:: GradientAttack
:members:
:special-members:

.. autoclass:: GradientSignAttack
:members:
:special-members:

.. autoclass:: FGSM
:members:
:special-members:

.. autoclass:: LinfinityBasicIterativeAttack
:members:
:special-members:

.. autoclass:: BasicIterativeMethod
:members:
:special-members:

.. autoclass:: BIM
:members:
:special-members:

.. autoclass:: L1BasicIterativeAttack
:members:
:special-members:

.. autoclass:: L2BasicIterativeAttack
:members:
:special-members:

.. autoclass:: ProjectedGradientDescentAttack
:members:
:special-members:

.. autoclass:: ProjectedGradientDescent
:members:
:special-members:

.. autoclass:: PGD
:members:
:special-members:

.. autoclass:: RandomStartProjectedGradientDescentAttack
:members:
:special-members:

.. autoclass:: RandomProjectedGradientDescent
:members:
:special-members:

.. autoclass:: RandomPGD
:members:
:special-members:

.. autoclass:: AdamL1BasicIterativeAttack
:members:
:special-members:

.. autoclass:: AdamL2BasicIterativeAttack
:members:
:special-members:

.. autoclass:: AdamProjectedGradientDescentAttack
:members:
:special-members:

.. autoclass:: AdamProjectedGradientDescent
:members:
:special-members:

.. autoclass:: AdamPGD
:members:
:special-members:

.. autoclass:: AdamRandomStartProjectedGradientDescentAttack
:members:
:special-members:

.. autoclass:: AdamRandomProjectedGradientDescent
:members:
:special-members:

.. autoclass:: AdamRandomPGD
:members:
:special-members:

.. autoclass:: MomentumIterativeAttack
:members:
:special-members:

.. autoclass:: MomentumIterativeMethod
:members:
:special-members:

.. autoclass:: LBFGSAttack
:members:
:special-members:

.. autoclass:: DeepFoolAttack
:members:
:special-members:

.. autoclass:: NewtonFoolAttack
:members:
:special-members:

.. autoclass:: DeepFoolL2Attack
:members:
:special-members:

.. autoclass:: DeepFoolLinfinityAttack
:members:
:special-members:

.. autoclass:: ADefAttack
:members:
:special-members:

.. autoclass:: SLSQPAttack
:members:
:special-members:

.. autoclass:: SaliencyMapAttack
:members:
:special-members:

.. autoclass:: IterativeGradientAttack
:members:
:special-members:

.. autoclass:: IterativeGradientSignAttack
:members:
:special-members:

.. autoclass:: CarliniWagnerL2Attack
:members:
:special-members:

.. autoclass:: EADAttack
:members:
:special-members:

.. autoclass:: DecoupledDirectionNormL2Attack
:members:
:special-members:

.. autoclass:: SparseFoolAttack
:members:
:special-members:

.. autoclass:: SparseL1BasicIterativeAttack
:members:
:special-members:

.. autoclass:: VirtualAdversarialAttack
:members:
:special-members:
16 changes: 16 additions & 0 deletions docs/modules/v1_attacks/other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Other attacks
-------------

.. currentmodule:: foolbox.attacks

.. autoclass:: BinarizationRefinementAttack
:members:
:special-members:

.. autoclass:: PrecomputedAdversarialsAttack
:members:
:special-members:

.. autoclass:: InversionAttack
:members:
:special-members:
16 changes: 16 additions & 0 deletions docs/modules/v1_attacks/score.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Score-based attacks
-----------------

.. currentmodule:: foolbox.attacks

.. autoclass:: SinglePixelAttack
:members:
:special-members:

.. autoclass:: LocalSearchAttack
:members:
:special-members:

.. autoclass:: ApproximateLBFGSAttack
:members:
:special-members:
3 changes: 1 addition & 2 deletions foolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
from . import criteria # noqa: F401
from . import distances # noqa: F401
from . import attacks # noqa: F401
from . import batch_attacks # noqa: F401
from . import v1 # noqa: F401
from . import utils # noqa: F401
from . import gradient_estimators # noqa: F401

from .adversarial import Adversarial # noqa: F401
from .yielding_adversarial import YieldingAdversarial # noqa: F401

from .batching import run_parallel # noqa: F401
from .batching import run_sequential # noqa: F401
Loading

0 comments on commit 4d6d7c1

Please sign in to comment.