Skip to content

Code for "On the Convergence of Prior-Guided Zeroth-Order Optimization Algorithms"

Notifications You must be signed in to change notification settings

csy530216/pg-zoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Experiments for PG-ZOO algorithms

Code (in Python 3) for the paper On the Convergence of Prior-Guided Zeroth-Order Optimization Algorithms to be appeared in NeurIPS 2021.

Numerical benchmarks

The numerical_benchmarks folder contains the code for experiments in Section 5.1 in the paper. The code is tested under numpy==1.18.0, matplotlib==3.1.2 with Python 3.7.

Reproducing Figure 1

Please run the following commands:

mkdir exp_pert
python exp_pert.py
python plot_exp_pert.py

Note: bias.npy corresponds to the vector b mentioned in Section D.1.1 in the appendix, which was generated by generate_bias.py (and you will obtain a different bias.npy if you rerun it).

Reproducing Figure 2

Please run the following commands:

mkdir exp
python exp.py
python plot_exp.py

Black-box adversarial attacks

The adversarial_attacks folder contains the code for experiments in Section 5.2 in the paper. The code is tested under torch==1.3.0, torchvision==0.4.1, numpy==1.17.3 with Python 3.7.

To reproduce the results in Table 1, for RGF methods, run

python rgf.py --lr {LEARNING_RATE}

For History-PRGF methods, run

python rgf.py --lr {LEARNING_RATE} --prior

For ARS methods, run

python ars.py --lr {LEARNING_RATE}

For History-PARS methods, run

python ars.py --lr {LEARNING_RATE} --prior

The model 'mnist_cnn.pt' is obtained from train.py.

About

Code for "On the Convergence of Prior-Guided Zeroth-Order Optimization Algorithms"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages