Move algos to NAS-Bench-201-algos

This commit is contained in:
D-X-Y
2021-06-03 01:32:00 -07:00
parent 84462da79e
commit 5d7ccd445d
25 changed files with 33 additions and 33 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/BOHB.sh -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 2 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 2 parameters for dataset and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
seed=$2
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/BOHB-${dataset}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/BOHB.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} \
--search_space_name ${space} \
--arch_nas_dataset ${benchmark_file} \
--time_budget 12000 \
--n_iters 50 --num_samples 4 --random_fraction 0.0 --bandwidth_factor 3 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/DARTS-V1.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, tracking_status, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/DARTS-V1-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/DARTS-V1.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/nas-benchmark/algos/DARTS.config \
--arch_nas_dataset ${benchmark_file} \
--track_running_stats ${BN} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/DARTS-V2.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, tracking_status, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/DARTS-V2-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/DARTS-V2.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/nas-benchmark/algos/DARTS.config \
--arch_nas_dataset ${benchmark_file} \
--track_running_stats ${BN} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,48 @@
#!/bin/bash
# Efficient Neural Architecture Search via Parameter Sharing, ICML 2018
# bash ./scripts-search/NAS-Bench-201-algos/ENAS.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, BN-tracking-status, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/ENAS-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-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 ${space} \
--arch_nas_dataset ${benchmark_file} \
--track_running_stats ${BN} \
--config_path ./configs/nas-benchmark/algos/ENAS.config \
--controller_entropy_weight 0.0001 \
--controller_bl_dec 0.99 \
--controller_train_steps 50 \
--controller_num_aggregate 20 \
--controller_num_samples 100 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/GDAS.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, BN-tracking, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/GDAS-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-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 ${space} \
--arch_nas_dataset ${benchmark_file} \
--config_path configs/nas-benchmark/algos/GDAS.config \
--tau_max 10 --tau_min 0.1 --track_running_stats ${BN} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,38 @@
#!/bin/bash
# Regularized Evolution for Image Classifier Architecture Search, AAAI 2019
# bash ./scripts-search/NAS-Bench-201-algos/R-EA.sh cifar10 3 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for the-dataset-name, the-ea-sample-size and the-seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
#dataset=cifar10
dataset=$1
sample_size=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/R-EA-${dataset}-SS${sample_size}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/R_EA.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} \
--search_space_name ${space} \
--arch_nas_dataset ${benchmark_file} \
--time_budget 12000 \
--ea_cycles 200 --ea_population 10 --ea_sample_size ${sample_size} --ea_fast_by_api 1 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Random Search and Reproducibility for Neural Architecture Search, UAI 2019
# bash ./scripts-search/NAS-Bench-201-algos/RANDOM-NAS.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, BN-tracking-status, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/RANDOM-NAS-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-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 ${space} \
--track_running_stats ${BN} \
--arch_nas_dataset ${benchmark_file} \
--config_path ./configs/nas-benchmark/algos/RANDOM.config \
--select_num 100 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,3 @@
# 10 NAS algorithms in NAS-Bench-201
Each script in this folder corresponds to one NAS algorithm, you can simple run it by one command.

View File

@@ -0,0 +1,36 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/REINFORCE.sh 0.001 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, LR, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
LR=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/REINFORCE-${dataset}-${LR}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/reinforce.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} \
--search_space_name ${space} \
--arch_nas_dataset ${benchmark_file} \
--time_budget 12000 \
--learning_rate ${LR} --EMA_momentum 0.9 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,34 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/Random.sh -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 2 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 2 parameters for dataset and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
seed=$2
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/RAND-${dataset}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/RANDOM.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} \
--search_space_name ${space} \
--arch_nas_dataset ${benchmark_file} \
--time_budget 12000 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,45 @@
#!/bin/bash
# One-Shot Neural Architecture Search via Self-Evaluated Template Network, ICCV 2019
# bash ./scripts-search/NAS-Bench-201-algos/SETN.sh cifar10 0 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, BN-tracking-status, and seed"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
seed=$3
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/SETN-${dataset}-BN${BN}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-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 ${space} \
--arch_nas_dataset ${benchmark_file} \
--config_path configs/nas-benchmark/algos/SETN.config \
--track_running_stats ${BN} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--select_num 100 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,44 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201-algos/DARTS-test-Gradient.sh cifar10 0 5
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, tracking_status, and gradient_clip"
exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
echo "Must set TORCH_HOME envoriment variable for data dir saving"
exit 1
else
echo "TORCH_HOME : $TORCH_HOME"
fi
dataset=$1
BN=$2
gradient_clip=$3
seed=-1
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
#benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth
benchmark_file=${TORCH_HOME}/NAS-Bench-201-v1_1-096897.pth
save_dir=./output/search-cell-${space}/DARTS-V1-${dataset}-BN${BN}-Gradient${gradient_clip}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/DARTS-V1.py \
--save_dir ${save_dir} --max_nodes ${max_nodes} --channel ${channel} --num_cells ${num_cells} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/nas-benchmark/algos/DARTS.config \
--arch_nas_dataset ${benchmark_file} \
--track_running_stats ${BN} --gradient_clip ${gradient_clip} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,10 @@
#!/bin/bash
echo script name: $0
#lrs="0.01 0.02 0.1 0.2 0.5 1.0 1.5 2.0 2.5 3.0"
lrs="0.01 0.02 0.1 0.2 0.5"
for lr in ${lrs}
do
bash ./scripts-search/NAS-Bench-201-algos/REINFORCE.sh ${lr} -1
done