Git Product home page Git Product logo

soap's People

Contributors

changhaoshih avatar gmishne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jellyfish1456

soap's Issues

I was confused by the `evaluate_adversarial` program

I found that IDEA is innovative after reading this paper. But there were some things that bothered me during I read the code of model prediction phase that I hope you can answer it.

SOAP/main.py

Lines 288 to 289 in 0953512

if args.attack is not None:
evaluate_adversarial(model, test_loader, criterion, aux_criterion, attack, pfy, device)

Begin to evaluate adversarial smaples in abode code.

  1. when defense CW attack, why should pass in the parameter y and it's impossible to know y at the prediction stage.

    SOAP/attacks.py

    Lines 84 to 88 in 0953512

    def cw(model, criterion, X, y=None, epsilon=0.1, num_classes=10):
    delta = L2Adversary()(model, X.clone().detach(), y, num_classes=num_classes).to(X.device) - X
    delta_norm = torch.norm(delta, p=2, dim=(1,2,3), keepdim=True) + 1e-4
    delta_proj = (delta_norm > epsilon) * delta / delta_norm * epsilon + (delta_norm < epsilon) * delta
    return delta_proj

    assert len(targets.size()) == 1

  2. defense_wrapper function are handled in different ways depending on the attack method, but it's impossible to know which attack method the sample was generated by at the prediction stage.

Could you explain it? please.

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.