diff --git a/adversarial/advbox/attacks/base.py b/adversarial/advbox/attacks/base.py index dab1dbbeb0270d303dbec1bd0b28a43e9d26f075..2058e3cfeb17dfce2713c38748f2a628e83a69f1 100644 --- a/adversarial/advbox/attacks/base.py +++ b/adversarial/advbox/attacks/base.py @@ -1,11 +1,7 @@ """ The base model of the model. """ -from abc import ABCMeta -#from advbox.base import Model -import abc - -abstractmethod = abc.abstractmethod +from abc import ABCMeta, abstractmethod class Attack(object): diff --git a/adversarial/advbox/attacks/gradientsign.py b/adversarial/advbox/attacks/gradientsign.py index 37fbdb11328a66a37ec58621ad92dbd3db6d58ed..dff518811efbbab6b5546380378115e2589398b7 100644 --- a/adversarial/advbox/attacks/gradientsign.py +++ b/adversarial/advbox/attacks/gradientsign.py @@ -30,9 +30,7 @@ class GradientSignAttack(Attack): gradient_sign.shape) + epsilon * gradient_sign adv_img = np.clip(adv_img, min_, max_) adv_label = np.argmax(self.model.predict([(adv_img, 0)])) - #print("pre_label="+str(pre_label)+ " adv_label="+str(adv_label)) if pre_label != adv_label: - #print(epsilon, pre_label, adv_label) return adv_img