深度学习调参-超参数排列组合
首先定义超参数的名称和取值范围,
然后调用itertools.product,可以生成所有超参数的排列组合。
1  | import itertools  | 
输出:
==== we have 54 cases in total =========
 *** 1 / 54  *********
python mnist_cnn.py --layer_n=1 --activition=tanh --seed=11
 *** 2 / 54  *********
python mnist_cnn.py --layer_n=1 --activition=tanh --seed=17
 *** 3 / 54  *********
python mnist_cnn.py --layer_n=1 --activition=tanh --seed=19
 *** 4 / 54  *********
python mnist_cnn.py --layer_n=1 --activition=sigmod --seed=11
 *** 5 / 54  *********
python mnist_cnn.py --layer_n=1 --activition=sigmod --seed=17
 *** 6 / 54  *********
 
 ...
 *** 53 / 54  *********
python mnist_cnn.py --layer_n=6 --activition=relu --seed=17
 *** 54 / 54  *********
python mnist_cnn.py --layer_n=6 --activition=relu --seed=19