We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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(_l099/size)+1 l1 = int(99np.sum(np.abs(img[0] - img_adv[0])) / np.sum(np.abs(img[0]))) + 1 #l2 = int(99np.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?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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(_l099/size)+1
l1 = int(99np.sum(np.abs(img[0] - img_adv[0])) / np.sum(np.abs(img[0]))) + 1
#l2 = int(99np.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?
The text was updated successfully, but these errors were encountered: