我有以下形式的功能:
def NN(epochs = None, hidden_nodes = None):
# ... calculations...
return score
我想通过一组可能的参数组合记录它的返回值:
epochs = [10, 100]
architecture = [
[5, 10],
[5, 10],
[5, 10]
]
我的意思是我想使用以如下方式指定的参数集的组合多次运行该函数并收集结果值:
NN(epochs = 10, hidden_nodes = [5])
NN(epochs = 10, hidden_nodes = [10])
NN(epochs = 10, hidden_nodes = [5, 5])
NN(epochs = 10, hidden_nodes = [5, 10])
NN(epochs = 10, hidden_nodes = [10, 5])
NN(epochs = 10, hidden_nodes = [10, 10])
NN(epochs = 10, hidden_nodes = [5, 5, 5])
NN(epochs = 10, hidden_nodes = [5, 5, 10])
NN(epochs = 10, hidden_nodes = [5, 10, 10])
NN(epochs = 10, hidden_nodes = [10, 10, 10])
NN(epochs = 10, hidden_nodes = [5, 10, 5])
...
NN(epochs = 100, hidden_nodes = [ 5])
NN(epochs = 100, hidden_nodes = [10])
NN(epochs = 100, hidden_nodes = [5, 5])
...
解决此类问题的一种好的、易读的方法是什么?