提交 c2b80706 编写于 作者: lyz_sea's avatar lyz_sea

mask array flatten

上级 1688818a
......@@ -63,7 +63,7 @@ class SaliencyMapAttack(Attack):
return adversary
# stop if mask is all zero
if not any(mask):
if not any(mask.flatten()):
return adversary
logging.info('step = {}, original_label = {}, adv_label={}'.
......@@ -105,9 +105,6 @@ class SaliencyMapAttack(Attack):
target_labels = [t for t in target_labels if t != original_label]
target_labels = target_labels[:num_random_target]
# str_target_labels = [str(t) for t in target_labels]
# logging.info('Random target labels: {}'.format(', '.join(str_target_labels)))
return target_labels
def _saliency_map(self, image, target, labels, mask, fast=False):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册