Giter VIP home page Giter VIP logo

fgsm's Issues

Question about env_name [NAME]

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]**

question

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'

Need help understanding the following lines..

FGSM/solver.py

Line 291 in d5e730b

changed[:, 0, :, :] = where(changed[:, 0, :, :] == 1, 252, 91)

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!

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.