def generate_network_list(nn_param_choices):
"""Generate a list of all possible networks.
Args:
nn_param_choices (dict): The parameter choices
Returns:
networks (list): A list of network objects
"""
networks = []
# This is silly.
for nbn in nn_param_choices['nb_neurons']:
for nbl in nn_param_choices['nb_layers']:
for a in nn_param_choices['activation']:
for o in nn_param_choices['optimizer']:
# Set the parameters.
network = {
'nb_neurons': nbn,
'nb_layers': nbl,
'activation': a,
'optimizer': o,
}
# Instantiate a network object with set parameters.
network_obj = Network()
network_obj.create_set(network)
networks.append(network_obj)
return networks
评论列表
文章目录