-
大小: 7KB文件类型: .py金币: 1下载: 0 次发布日期: 2021-01-06
- 语言: Python
- 标签: DeepFool adversarial 对抗样本
资源简介
DeepFool对抗算法实现代码,需先下载cleverhans集成库,或是我资源中的FGSM算法也可以。
代码片段和文件信息
# adapted from mnist_tutorial_cw.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from six.moves import xrange
import tensorflow as tf
from tensorflow.python.platform import flags
import logging
import os
from cleverhans.attacks import DeepFool
from cleverhans.utils import pair_visual grid_visual AccuracyReport
from cleverhans.utils import set_log_level
from cleverhans.utils_mnist import data_mnist
from cleverhans.utils_tf import model_train model_eval tf_model_load
from cleverhans_master.cleverhans_tutorials.tutorial_models import make_basic_cnn
FLAGS = flags.FLAGS
def mnist_tutorial_deepfool(train_start=0 train_end=60000 test_start=0
评论
共有 条评论