autodl-projects/scripts-search/algos/ENAS.sh

47 lines
1.4 KiB
Bash
Raw Normal View History

2019-11-09 06:50:13 +01:00
#!/bin/bash
# Efficient Neural Architecture Search via Parameter Sharing, ICML 2018
2020-01-17 10:03:35 +01:00
# bash ./scripts-search/algos/ENAS.sh cifar10 0 -1
2019-11-09 06:50:13 +01:00
echo script name: $0
echo $# arguments
if [ "$#" -ne 3 ] ;then
2019-11-09 06:50:13 +01:00
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for dataset, BN-tracking-status, and seed"
2019-11-09 06:50:13 +01:00
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
2019-11-09 06:50:13 +01:00
channel=16
num_cells=5
max_nodes=4
space=nas-bench-201
2019-11-09 06:50:13 +01:00
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}/ENAS-${dataset}-BN${BN}
2019-11-09 06:50:13 +01:00
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} \
2019-12-23 11:29:03 +01:00
--search_space_name ${space} \
--arch_nas_dataset ${TORCH_HOME}/NAS-Bench-201-v1_0-e61699.pth \
--track_running_stats ${BN} \
2019-11-09 06:50:13 +01:00
--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}