Giter Club home page Giter Club logo

adversarial_examples's People

Contributors

duoergun0729 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

adversarial_examples's Issues

9-cleverhans代码环境配置有误

我在运行cleverhans部分代码时候,发现正确的运行环境应该配置cleverhans==3.0.0或者3.0.1,兜哥在书中写的是2.1.0.

bug

对5-fgm-tensorflow-pb中攻击后图像进行保存,重新输入到模型进行识别时,结果显示未攻击成功。

计算L范数的相对值

https://github.com/duoergun0729/adversarial_examples/blob/master/code/tools.py
#计算相对量
#l0 = int(99len(np.where(np.abs(img[0] - img_adv[0])>0.5)[0]) / size ) + 1
l0=int(_l0
99/size)+1
l1 = int(99np.sum(np.abs(img[0] - img_adv[0])) / np.sum(np.abs(img[0]))) + 1
#l2 = int(99
np.linalg.norm(img[0] - img_adv[0]) / np.linalg.norm(img[0])) + 1
l2=int(99*_l2 / np.linalg.norm(img[0])) + 1
#linf = int(99np.max(np.abs(img[0] - img_adv[0])) / 255) + 1
linf = int(99
_linf / 255) + 1
print('Noise L_0 norm: {} {}%'.format(_l0,l0) )
print('Noise L_2 norm: {} {}%'.format(_l2,l2) )
print('Noise L_inf norm: {} {}%'.format(_linf,linf) )

为什么要乘99,以及为什么要加1?

5-jsma-pytorch.ipynb代码在cuda上运行代码修改

兜哥您好,我在复现您的code/5-jsma-pytorch.ipynb代码时候,发现循环训练中最后一行
img.data[idx]=np.clip(img.data[idx], min_, max_)
该行代码在cuda上运行需要修改,img在cuda上运行的时候,因为img是cuda tensor,需要转化为cpu tensor,再进行numpy运算。
img.data[idx]=np.clip(img.data[idx].cpu(), min_, max_)

TypeError: true_divide() received an invalid combination of arguments

运行9-advbox-mnist-fgsm代码报错查了一些博客说是python版本的问题具体解决方法还是不清楚
TypeError: true_divide() received an invalid combination of arguments - got (numpy.ndarray, int), but expected one of:

  • (Tensor input, Tensor other, *, Tensor out)
  • (Tensor input, Number other)
    didn't match because some of the arguments have invalid types: (numpy.ndarray, int)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.