Skip to content

Commit

Permalink
v3.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry24k committed Apr 5, 2022
1 parent 4447248 commit 315913f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions UPDATE_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,12 @@
* `save`: Now saving images and labels for every batch.
* `OnePixel`: Now supports targeted version.
* `_get_target_label`: Now generates target label under evaluation mode and `torch.no_grad()`.






### v3.2.6

* `_differential_evolution`: [bug fixed](https://github.com/Harry24k/adversarial-attacks-pytorch/issues/61).
2 changes: 1 addition & 1 deletion torchattacks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
from .attacks.jitter import Jitter
from .attacks.pixle import Pixle

__version__ = '3.2.5'
__version__ = '3.2.6'
13 changes: 12 additions & 1 deletion torchattacks/attacks/_differential_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import OptimizeResult, minimize
from scipy.optimize.optimize import _status_message
# from scipy.optimize.optimize import _status_message % for version < 1.8
# from scipy.optimize.optimize_ import _status_message % for version >= 1.8
from scipy._lib._util import check_random_state
from six import string_types


__all__ = ['differential_evolution']
_status_message = {'success': 'Optimization terminated successfully.',
'maxfev': 'Maximum number of function evaluations has '
'been exceeded.',
'maxiter': 'Maximum number of iterations has been '
'exceeded.',
'pr_loss': 'Desired error not necessarily achieved due '
'to precision loss.',
'nan': 'NaN result encountered.',
'out_of_bounds': 'The result is outside of the provided '
'bounds.'}

_MACHEPS = np.finfo(np.float64).eps

Expand Down

0 comments on commit 315913f

Please sign in to comment.