1konny / fgsm Goto Github PK
View Code? Open in Web Editor NEWSimple pytorch implementation of FGSM and I-FGSM
Simple pytorch implementation of FGSM and I-FGSM
I notice that your code only have un-target attack part. But target-attack, where we can specify the target class mannually is loss/missing?
Hi @1Konny Can you please give me an example how to run this code? I am confused what should I put into [NAME]? Can you provide one example. Thanks.
python main.py --mode train --env_name **[NAME]**
Isn't it supposed to be # x_adv = x_adv + eps*x_adv.grad?
python main.py --mode generate --iteration 1 --epsilon 0.03 --load_ckpt best_acc.tar
Traceback (most recent call last):
File "main.py", line 75, in
main(args)
File "main.py", line 39, in main
iteration=args.iteration)
File "G:\FGSM-master\solver.py", line 213, in generate
pad_value=0.5)
File "F:\anaconda\envs\cw\lib\site-packages\torchvision\utils.py", line 105, in save_image
im.save(filename)
File "F:\anaconda\envs\cw\lib\site-packages\PIL\Image.py", line 2237, in save
fp = builtins.open(filename, "w+b")
OSError: [Errno 22] Invalid argument: 'output\main\legitimate(t:-1,e:0.03,i:1).jpg'
Line 291 in d5e730b
do you know if we can get the dimensions automatically based on the input and output shapes? It is really hard to understand what these are doing. I am trying to use the same code for attacks on different datasets and would like to have a neat way to infer these indices/repeats from the input shapes.
It would be wonderful if you could explain the four lines related to changed and where(), thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.