提交 bf1e0372 编写于 作者: G gx_wind

delete comment

上级 343b32a0
""" """
The base model of the model. The base model of the model.
""" """
from abc import ABCMeta from abc import ABCMeta, abstractmethod
#from advbox.base import Model
import abc
abstractmethod = abc.abstractmethod
class Attack(object): class Attack(object):
......
...@@ -30,9 +30,7 @@ class GradientSignAttack(Attack): ...@@ -30,9 +30,7 @@ class GradientSignAttack(Attack):
gradient_sign.shape) + epsilon * gradient_sign gradient_sign.shape) + epsilon * gradient_sign
adv_img = np.clip(adv_img, min_, max_) adv_img = np.clip(adv_img, min_, max_)
adv_label = np.argmax(self.model.predict([(adv_img, 0)])) 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: if pre_label != adv_label:
#print(epsilon, pre_label, adv_label)
return adv_img return adv_img
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册