add autodl

This commit is contained in:
mhz
2024-08-25 18:02:31 +02:00
parent 192f286cfb
commit a0a25f291c
431 changed files with 50646 additions and 8 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

View File

@@ -0,0 +1,26 @@
#!/bin/bash
# bash scripts-search/NAS-Bench-201/build.sh
echo script name: $0
echo $# arguments
if [ "$#" -ne 0 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 0 parameters"
exit 1
fi
save_dir=./output/nas_bench_201_package
echo "Prepare to build the package in ${save_dir}"
rm -rf ${save_dir}
mkdir -p ${save_dir}
#cp NAS-Bench-201.md ${save_dir}/README.md
sed '125,187d' NAS-Bench-201.md > ${save_dir}/README.md
cp LICENSE.md ${save_dir}/LICENSE.md
cp -r lib/nas_201_api ${save_dir}/
rm -rf ${save_dir}/nas_201_api/__pycache__
cp exps/NAS-Bench-201/dist-setup.py ${save_dir}/setup.py
cd ${save_dir}
# python setup.py sdist bdist_wheel
# twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# twine upload dist/*

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# bash scripts-search/NAS-Bench-201/meta-gen.sh NAS-BENCH-201 4
echo script name: $0
echo $# arguments
if [ "$#" -ne 2 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 2 parameters for save-dir-name and maximum-node-in-cell"
exit 1
fi
name=$1
node=$2
save_dir=./output/${name}-${node}
python ./exps/NAS-Bench-201/main.py --mode meta --save_dir ${save_dir} --max_node ${node}

View File

@@ -0,0 +1,34 @@
#!/bin/bash
# bash ./scripts-search/NAS-Bench-201/train-a-net.sh resnet 16 5
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for network, channel, num-of-cells"
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
model=$1
channel=$2
num_cells=$3
save_dir=./output/NAS-BENCH-201-4/
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201/main.py \
--mode specific-${model} --save_dir ${save_dir} --max_node 4 \
--datasets cifar10 cifar10 cifar100 ImageNet16-120 \
--use_less 0 \
--splits 1 0 0 0 \
--xpaths $TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python/ImageNet16 \
--channel ${channel} --num_cells ${num_cells} \
--workers 4 \
--seeds 777 888 999

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# bash ./scripts-search/train-models.sh 0/1 0 100 -1 '777 888 999'
echo script name: $0
echo $# arguments
if [ "$#" -ne 5 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 5 parameters for use-less-or-not, start-and-end, arch-index, and seeds"
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
use_less=$1
xstart=$2
xend=$3
arch_index=$4
all_seeds=$5
save_dir=./output/NAS-BENCH-201-4/
if [ ${arch_index} == "-1" ]; then
mode=new
else
mode=cover
fi
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201/main.py \
--mode ${mode} --save_dir ${save_dir} --max_node 4 \
--use_less ${use_less} \
--datasets cifar10 cifar10 cifar100 ImageNet16-120 \
--splits 1 0 0 0 \
--xpaths $TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python \
$TORCH_HOME/cifar.python/ImageNet16 \
--channel 16 --num_cells 5 \
--workers 4 \
--srange ${xstart} ${xend} --arch_index ${arch_index} \
--seeds ${all_seeds}

View File

@@ -0,0 +1,41 @@
#!/bin/bash
# bash ./scripts-search/NASNet-space-search-by-DARTS1V.sh cifar10 -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
BN=1
seed=$2
channel=16
num_cells=5
max_nodes=4
space=darts
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
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/search-opts/DARTS-NASNet-CIFAR.config \
--model_config configs/search-archs/DARTS-NASNet-CIFAR.config \
--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
# bash ./scripts-search/NASNet-space-search-by-GDAS-FRC.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, track_running_stats, 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
track_running_stats=$2
seed=$3
space=darts
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
save_dir=./output/search-cell-${space}/GDAS-FRC-${dataset}-BN${track_running_stats}
OMP_NUM_THREADS=4 python ./exps/algos/GDAS.py \
--save_dir ${save_dir} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/search-opts/GDAS-NASNet-CIFAR.config \
--model_config configs/search-archs/GDASFRC-NASNet-CIFAR.config \
--tau_max 10 --tau_min 0.1 --track_running_stats ${track_running_stats} \
--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
# bash ./scripts-search/NASNet-space-search-by-GDAS.sh cifar10 1 -1
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, track_running_stats, 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
track_running_stats=$2
seed=$3
space=darts
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
save_dir=./output/search-cell-${space}/GDAS-${dataset}-BN${track_running_stats}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/GDAS.py \
--save_dir ${save_dir} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/search-opts/GDAS-NASNet-CIFAR.config \
--model_config configs/search-archs/GDAS-NASNet-CIFAR.config \
--tau_max 10 --tau_min 0.1 --track_running_stats ${track_running_stats} \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,40 @@
#!/bin/bash
# bash ./scripts-search/NASNet-space-search-by-SETN.sh cifar10 1 -1
# [TO BE DONE]
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, track_running_stats, 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
track_running_stats=$2
seed=$3
space=darts
if [ "$dataset" == "cifar10" ] || [ "$dataset" == "cifar100" ]; then
data_path="$TORCH_HOME/cifar.python"
else
data_path="$TORCH_HOME/cifar.python/ImageNet16"
fi
save_dir=./output/search-cell-${space}/SETN-${dataset}-BN${track_running_stats}
OMP_NUM_THREADS=4 python ./exps/NAS-Bench-201-algos/SETN.py \
--save_dir ${save_dir} \
--dataset ${dataset} --data_path ${data_path} \
--search_space_name ${space} \
--config_path configs/search-opts/SETN-NASNet-CIFAR.config \
--model_config configs/search-archs/SETN-NASNet-CIFAR.config \
--track_running_stats ${track_running_stats} \
--select_num 1000 \
--arch_learning_rate 0.0003 --arch_weight_decay 0.001 \
--workers 4 --print_freq 200 --rand_seed ${seed}

View File

@@ -0,0 +1,33 @@
#!/bin/bash
# bash scripts-search/NATS/search-size.sh 0 0.3 777
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for GPU-device, warmup-ratio, 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
device=$1
ratio=$2
seed=$3
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar10 --data_path $TORCH_HOME/cifar.python --algo tas --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar100 --data_path $TORCH_HOME/cifar.python --algo tas --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset ImageNet16-120 --data_path $TORCH_HOME/cifar.python/ImageNet16 --algo tas --warmup_ratio ${ratio} --rand_seed ${seed}
#
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar10 --data_path $TORCH_HOME/cifar.python --algo mask_gumbel --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar100 --data_path $TORCH_HOME/cifar.python --algo mask_gumbel --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset ImageNet16-120 --data_path $TORCH_HOME/cifar.python/ImageNet16 --algo mask_gumbel --warmup_ratio ${ratio} --rand_seed ${seed}
#
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar10 --data_path $TORCH_HOME/cifar.python --algo mask_rl --arch_weight_decay 0 --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset cifar100 --data_path $TORCH_HOME/cifar.python --algo mask_rl --arch_weight_decay 0 --warmup_ratio ${ratio} --rand_seed ${seed}
CUDA_VISIBLE_DEVICES=${device} python ./exps/NATS-algos/search-size.py --dataset ImageNet16-120 --data_path $TORCH_HOME/cifar.python/ImageNet16 --algo mask_rl --arch_weight_decay 0 --warmup_ratio ${ratio} --rand_seed ${seed}

View File

@@ -0,0 +1,78 @@
#!/bin/bash
# bash ./scripts-search/search-depth-cifar.sh cifar10 ResNet110 CIFAR 0 0 0.57 777
# bash ./scripts-search/search-depth-cifar.sh cifar10 ResNet110 CIFARX 0 0 0.57 777
set -e
echo script name: $0
echo $# arguments
if [ "$#" -ne 7 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 7 parameters for the dataset and the-model-name and the-optimizer and gumbel-max/min and FLOP-ratio and the-random-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
model=$2
optim=$3
batch=256
gumbel_min=$4
gumbel_max=$5
expected_FLOP_ratio=$6
rseed=$7
SAVE_ROOT="./output"
save_dir=${SAVE_ROOT}/search-depth/${dataset}-${model}-${optim}-Gumbel_${gumbel_min}_${gumbel_max}-${expected_FLOP_ratio}
python --version
OMP_NUM_THREADS=4 python ./exps/TAS/search-shape.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ./configs/archs/CIFAR-${model}.config \
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
--optim_config ./configs/search-opts/${optim}.config \
--search_shape depth \
--procedure search \
--FLOP_ratio ${expected_FLOP_ratio} \
--FLOP_weight 2 --FLOP_tolerant 0.05 \
--save_dir ${save_dir} \
--gumbel_tau_max ${gumbel_max} --gumbel_tau_min ${gumbel_min} \
--cutout_length -1 \
--batch_size ${batch} --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
if [ "$rseed" = "-1" ]; then
echo "Skip training the best configuration"
else
# normal training
xsave_dir=${save_dir}/seed-${rseed}-NMT
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--procedure basic \
--save_dir ${xsave_dir} \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
# KD training
xsave_dir=${save_dir}/seed-${rseed}-KDT
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--KD_checkpoint ./.latent-data/basemodels/${dataset}/${model}.pth \
--procedure Simple-KD \
--save_dir ${xsave_dir} \
--KD_alpha 0.9 --KD_temperature 4 \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
fi

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# bash ./scripts-search/search-depth-gumbel.sh cifar10 ResNet110 CIFARX 0.57 777
set -e
echo script name: $0
echo $# arguments
if [ "$#" -ne 5 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 5 parameters for the dataset and the-model-name and the-optimizer and FLOP-ratio and the-random-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
model=$2
optim=$3
expected_FLOP_ratio=$4
rseed=$5
bash ./scripts-search/search-depth-cifar.sh ${dataset} ${model} ${optim} 0.1 5 ${expected_FLOP_ratio} ${rseed}

View File

@@ -0,0 +1,73 @@
#!/bin/bash
# bash ./scripts-search/search-shape-cifar.sh cifar10 ResNet110 CIFAR 0.57 777
set -e
echo script name: $0
echo $# arguments
if [ "$#" -ne 5 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 5 parameters for the dataset and the-model-name and the-optimizer and FLOP-ratio and the-random-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
model=$2
optim=$3
batch=256
gumbel_min=0.1
gumbel_max=5
expected_FLOP_ratio=$4
rseed=$5
save_dir=./output/search-shape/${dataset}-${model}-${optim}-Gumbel_${gumbel_min}_${gumbel_max}-${expected_FLOP_ratio}
python --version
OMP_NUM_THREADS=4 python ./exps/TAS/search-transformable.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ./configs/archs/CIFAR-${model}.config \
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
--optim_config ./configs/search-opts/${optim}.config \
--procedure search-v2 \
--FLOP_ratio ${expected_FLOP_ratio} \
--FLOP_weight 2 --FLOP_tolerant 0.05 \
--save_dir ${save_dir} \
--gumbel_tau_max ${gumbel_max} --gumbel_tau_min ${gumbel_min} \
--cutout_length -1 \
--batch_size ${batch} --rand_seed ${rseed} --workers 6 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
if [ "$rseed" = "-1" ]; then
echo "Skip training the last configuration"
else
# normal training
xsave_dir=${save_dir}/seed-${rseed}-NMT
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--procedure basic \
--save_dir ${xsave_dir} \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 6 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
# KD training
xsave_dir=${save_dir}/seed-${rseed}-KDT
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--KD_checkpoint ./.latent-data/basemodels/${dataset}/${model}.pth \
--procedure Simple-KD \
--save_dir ${xsave_dir} \
--KD_alpha 0.9 --KD_temperature 4 \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 6 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
fi

View File

@@ -0,0 +1,78 @@
#!/bin/bash
# bash ./scripts-search/search-width-cifar.sh cifar10 ResNet110 CIFAR 0 0 0.57 777
# bash ./scripts-search/search-width-cifar.sh cifar10 ResNet110 CIFARX 0 0 0.57 777
set -e
echo script name: $0
echo $# arguments
if [ "$#" -ne 7 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 7 parameters for the dataset and the-model-name and the-optimizer and gumbel-max/min and FLOP-ratio and the-random-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
model=$2
optim=$3
batch=256
gumbel_min=$4
gumbel_max=$5
expected_FLOP_ratio=$6
rseed=$7
SAVE_ROOT="./output"
save_dir=${SAVE_ROOT}/search-width/${dataset}-${model}-${optim}-Gumbel_${gumbel_min}_${gumbel_max}-${expected_FLOP_ratio}
python --version
OMP_NUM_THREADS=4 python ./exps/TAS/search-shape.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ./configs/archs/CIFAR-${model}.config \
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
--optim_config ./configs/search-opts/${optim}.config \
--search_shape width \
--procedure search \
--FLOP_ratio ${expected_FLOP_ratio} \
--FLOP_weight 2 --FLOP_tolerant 0.05 \
--save_dir ${save_dir} \
--gumbel_tau_max ${gumbel_max} --gumbel_tau_min ${gumbel_min} \
--cutout_length -1 \
--batch_size ${batch} --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
if [ "$rseed" = "-1" ]; then
echo "Skip training the best configuration"
else
# normal training
xsave_dir=${save_dir}/seed-${rseed}-NMT
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--procedure basic \
--save_dir ${xsave_dir} \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
# KD training
xsave_dir=${save_dir}/seed-${rseed}-KDT
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
--data_path $TORCH_HOME/cifar.python \
--model_config ${save_dir}/seed-${rseed}-last.config \
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
--KD_checkpoint ./.latent-data/basemodels/${dataset}/${model}.pth \
--procedure Simple-KD \
--save_dir ${xsave_dir} \
--KD_alpha 0.9 --KD_temperature 4 \
--cutout_length -1 \
--batch_size 256 --rand_seed ${rseed} --workers 4 \
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
fi

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# bash ./scripts-search/search-width-gumbel.sh cifar10 ResNet110 CIFARX 0.57 777
set -e
echo script name: $0
echo $# arguments
if [ "$#" -ne 5 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 5 parameters for the dataset and the-model-name and the-optimizer and FLOP-ratio and the-random-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
model=$2
optim=$3
expected_FLOP_ratio=$4
rseed=$5
bash ./scripts-search/search-width-cifar.sh ${dataset} ${model} ${optim} 0.1 5 ${expected_FLOP_ratio} ${rseed}