Skip to content
/ OSGD Public

This repository is the official implementation of Adversarial Purification with One-Step Guided Diffusion Model

Notifications You must be signed in to change notification settings

zmlix/OSGD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adversarial Purification with One-Step Guided Diffusion Model

This repository is the official implementation of Adversarial Purification with One-Step Guided Diffusion Model

sample sample algorithm algorithm algorithm

Requirements

To install requirements:

pip install -r requirements.txt

If you want to enable mixed-precision computation using the apex library, please install the apex library.

git clone https://github.com/NVIDIA/apex
cd apex
pip3 install -v --no-cache-dir ./

(Maybe) Solution for 'IndexError: tuple index out of range': NVIDIA/apex#694 (comment)

Pre-trained Models

You can download pretrained models here:

Evaluation

To evaluate my model on Cifar10, run:

python3 -m torch.distributed.launch --nproc_per_node=4 run.py --mode pgd --T 400 --scale 50000

To evaluate my model on ImageNet, run:

python3 -m torch.distributed.launch --nproc_per_node=4 run.py --mode pgd --T 100 --scale 2000 --model resnet152

Contributing

This implementation is based on / inspired by:

About

This repository is the official implementation of Adversarial Purification with One-Step Guided Diffusion Model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages