diff --git a/NAS-Bench-102.md b/NAS-Bench-102.md index 78bfeef..883274b 100644 --- a/NAS-Bench-102.md +++ b/NAS-Bench-102.md @@ -1,7 +1,7 @@ # [NAS-BENCH-102: Extending the Scope of Reproducible Neural Architecture Search](https://openreview.net/forum?id=HJxyZkBKDr) We propose an algorithm-agnostic NAS benchmark (NAS-Bench-102) with a fixed search space, which provides a unified benchmark for almost any up-to-date NAS algorithms. -The design of our search space is inspired from that used in the most popular cell-based searching algorithms, where a cell is represented as a directed acyclic graph. +The design of our search space is inspired by that used in the most popular cell-based searching algorithms, where a cell is represented as a directed acyclic graph. Each edge here is associated with an operation selected from a predefined operation set. For it to be applicable for all NAS algorithms, the search space defined in NAS-Bench-102 includes 4 nodes and 5 associated operation options, which generates 15,625 neural cell candidates in total. diff --git a/README.md b/README.md index fb4a608..ed94dfc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Nueral Architecture Search (NAS) +# Neural Architecture Search (NAS) -This project contains the following neural architecture search algorithms, implemented in [PyTorch](http://pytorch.org). +This project contains the following neural architecture search (NAS) algorithms, implemented in [PyTorch](http://pytorch.org). More NAS resources can be found in [Awesome-NAS](https://github.com/D-X-Y/Awesome-NAS). - NAS-Bench-102: Extending the Scope of Reproducible Neural Architecture Search, ICLR 2020 @@ -158,6 +158,7 @@ If you find that this project helps your research, please consider citing some o title = {One-Shot Neural Architecture Search via Self-Evaluated Template Network}, author = {Dong, Xuanyi and Yang, Yi}, booktitle = {Proceedings of the IEEE International Conference on Computer Vision (ICCV)}, + pages = {3681--3690}, year = {2019} } @inproceedings{dong2019search, diff --git a/scripts-search/algos/BOHB.sh b/scripts-search/algos/BOHB.sh index 31a1c91..c08f5c6 100644 --- a/scripts-search/algos/BOHB.sh +++ b/scripts-search/algos/BOHB.sh @@ -19,6 +19,7 @@ seed=$1 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -26,12 +27,12 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/BOHB-${dataset} +save_dir=./output/search-cell-${space}/BOHB-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/BOHB.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ - --arch_nas_dataset ./output/AA-NAS-BENCH-4/simplifies/C16-N5-final-infos.pth \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --n_iters 6 --num_samples 3 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/ENAS.sh b/scripts-search/algos/ENAS.sh index 982a829..18a378f 100644 --- a/scripts-search/algos/ENAS.sh +++ b/scripts-search/algos/ENAS.sh @@ -20,6 +20,7 @@ seed=$2 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -27,12 +28,13 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/ENAS-${dataset} +save_dir=./output/search-cell-${space}/ENAS-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/ENAS.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --config_path ./configs/nas-benchmark/algos/ENAS.config \ --controller_entropy_weight 0.0001 \ --controller_bl_dec 0.99 \ diff --git a/scripts-search/algos/GDAS.sh b/scripts-search/algos/GDAS.sh index f030b06..61fc642 100644 --- a/scripts-search/algos/GDAS.sh +++ b/scripts-search/algos/GDAS.sh @@ -19,6 +19,7 @@ seed=$2 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -26,12 +27,13 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/GDAS-${dataset} +save_dir=./output/search-cell-${space}/GDAS-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/GDAS.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --tau_max 10 --tau_min 0.1 \ --arch_learning_rate 0.0003 --arch_weight_decay 0.001 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/R-EA.sh b/scripts-search/algos/R-EA.sh index 83c6f2b..a3d8edd 100644 --- a/scripts-search/algos/R-EA.sh +++ b/scripts-search/algos/R-EA.sh @@ -20,6 +20,7 @@ seed=$1 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -27,12 +28,12 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/R-EA-${dataset} +save_dir=./output/search-cell-${space}/R-EA-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/R_EA.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name nas-bench-102 \ + --search_space_name ${space} \ --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --ea_cycles 30 --ea_population 10 --ea_sample_size 3 --ea_fast_by_api 1 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/RANDOM-NAS.sh b/scripts-search/algos/RANDOM-NAS.sh index 97069fc..ba8e326 100644 --- a/scripts-search/algos/RANDOM-NAS.sh +++ b/scripts-search/algos/RANDOM-NAS.sh @@ -20,6 +20,7 @@ seed=$2 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -27,12 +28,13 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/RANDOM-NAS-${dataset} +save_dir=./output/search-cell-${space}/RANDOM-NAS-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/RANDOM-NAS.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --config_path ./configs/nas-benchmark/algos/RANDOM.config \ --select_num 100 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/REINFORCE.sh b/scripts-search/algos/REINFORCE.sh index f77f8ba..add5ac7 100644 --- a/scripts-search/algos/REINFORCE.sh +++ b/scripts-search/algos/REINFORCE.sh @@ -19,6 +19,7 @@ seed=$1 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -26,12 +27,12 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/REINFORCE-${dataset} +save_dir=./output/search-cell-${space}/REINFORCE-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/reinforce.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ - --arch_nas_dataset ./output/AA-NAS-BENCH-4/simplifies/C16-N5-final-infos.pth \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --learning_rate 0.001 --RL_steps 100 --EMA_momentum 0.9 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/Random.sh b/scripts-search/algos/Random.sh index 2945b08..63f49be 100644 --- a/scripts-search/algos/Random.sh +++ b/scripts-search/algos/Random.sh @@ -19,6 +19,7 @@ seed=$1 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -26,12 +27,12 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/RAND-${dataset} +save_dir=./output/search-cell-${space}/RAND-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/RANDOM.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ - --arch_nas_dataset ./output/AA-NAS-BENCH-4/simplifies/C16-N5-final-infos.pth \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --random_num 100 \ --workers 4 --print_freq 200 --rand_seed ${seed} diff --git a/scripts-search/algos/SETN.sh b/scripts-search/algos/SETN.sh index 1124209..4ee3dc0 100644 --- a/scripts-search/algos/SETN.sh +++ b/scripts-search/algos/SETN.sh @@ -20,6 +20,7 @@ seed=$2 channel=16 num_cells=5 max_nodes=4 +space=nas-bench-102 if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then data_path="$TORCH_HOME/cifar.python" @@ -27,12 +28,13 @@ else data_path="$TORCH_HOME/cifar.python/ImageNet16" fi -save_dir=./output/cell-search-tiny/SETN-${dataset} +save_dir=./output/search-cell-${space}/SETN-${dataset} OMP_NUM_THREADS=4 python ./exps/algos/SETN.py \ --save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \ --dataset ${dataset} --data_path ${data_path} \ - --search_space_name aa-nas \ + --search_space_name ${space} \ + --arch_nas_dataset ${TORCH_HOME}/NAS-Bench-102-v1_0-e61699.pth \ --config_path configs/nas-benchmark/algos/SETN.config \ --arch_learning_rate 0.0003 --arch_weight_decay 0.001 \ --select_num 100 \