From 7efec0a7b48ba9e8f33495b7e0360f9409add9fe Mon Sep 17 00:00:00 2001 From: Will Greedy Date: Mon, 7 Aug 2017 10:53:11 +0100 Subject: [PATCH] Fixed bug when using a non-zero lower bound (#56) --- foolbox/attacks/contrast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foolbox/attacks/contrast.py b/foolbox/attacks/contrast.py index 58bd96f6..f3cc5c36 100644 --- a/foolbox/attacks/contrast.py +++ b/foolbox/attacks/contrast.py @@ -12,7 +12,7 @@ class ContrastReductionAttack(Attack): def _apply(self, a, epsilons=1000): image = a.original_image min_, max_ = a.bounds() - target = (max_ - min_) / 2 + target = (max_ + min_) / 2 if not isinstance(epsilons, Iterable): epsilons = np.linspace(0, 1, num=epsilons + 1)[1:]