Skip to content

fanghenshaometeor/vanilla-adversarial-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vanilla-adversarial-training

This repo provides the PyTorch code for both vanilla training and adversarial training deep neural networks.

What

A brief description for the files in this repo:

train.py,.sh : training python and shell scripts

attack.py,.sh : attack python and shell scripts

utils.py : utility functions

model/ : model definitions directory

How

A brief description on how to train and attack the model.

Training

To reproduce the training, users can run the train.sh shell scripts directly on the command line.

sh train.sh

Detailed training settings (model architecture, data set and whether to perform adversarial training) could be specified freely in the train.sh script.

Attack

To attack the model, users can run the attack.sh shell scripts directly on the command line.

sh attack.sh

Detailed attacking settings could be specified freely by commenting some lines in the attack.sh script.

ATTENTION

  • The mean-var normalization preprocess is included in the model definitions.
  • The adversarial training is PGD-based: bound $l_\infty=8/255(0.031)$, step-size $2/255$ and $10$ iterations.
  • In adversarial training, the network prameters are updated with adversarial examples only.
  • The model is trained for $200$ epochs and the last model is selected.

Dependencies

  • python 3.6
  • PyTorch 1.7.0
  • AdverTorch 0.2.3

If u find the codes useful, welcome to fork and star this repo :)

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy