Code (in Python 3) for the paper On the Convergence of Prior-Guided Zeroth-Order Optimization Algorithms to be appeared in NeurIPS 2021.
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.
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).
Please run the following commands:
mkdir exp
python exp.py
python plot_exp.py
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
.