xautodl/TEMP/search.sh

46 lines
1.3 KiB
Bash
Raw Normal View History

2019-01-31 15:27:38 +01:00
#!/usr/bin/env sh
if [ "$#" -ne 3 ] ;then
echo "Input illegal number of parameters " $#
echo "Need 3 parameters for the GPUs and the network and the dataset"
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
gpus=$1
arch=$2
cutout=0
dataset=$3
epoch=50
SAVED=./snapshots/NAS/Search-${arch}-${dataset}-cut${cutout}-${epoch}
if [ "$dataset" == "cifar10" ] ;then
dataset_root=$TORCH_HOME/cifar.python
print_freq=100
elif [ "$dataset" == "cifar100" ] ;then
dataset_root=$TORCH_HOME/cifar.python
print_freq=100
elif [ "$dataset" == "tiered" ] ;then
dataset_root=$TORCH_HOME/tiered-imagenet
print_freq=500
else
echo 'invalid dataset-name :'${dataset}
exit 1
fi
CUDA_VISIBLE_DEVICES=${gpus} python ./exps-nas/train_search.py \
--data_path ${dataset_root} \
--arch ${arch} \
--dataset ${dataset} --batch_size 64 \
--save_path ${SAVED} \
--learning_rate_max 0.025 --learning_rate_min 0.001 --momentum 0.9 --weight_decay 0.0003 \
--epochs ${epoch} --cutout ${cutout} --validate --grad_clip 5 \
--init_channels 16 --layers 8 \
--manualSeed 3858 \
--model_config ./configs/nas-cifar-cos.config \
--print_freq ${print_freq} --workers 8