inter_n=10 try_n=1 study_data=[] for i in range(try_n): n=neuralNetwork(input_nodes,hidden_nodes,output_nodes,learning_rate) temp=[] for j in range(inter_n): n.train_all() temp.append((n.test(),n.w_in_hid,n.w_hid_out)) temp.sort(key=lambda x:x[0],reverse=True) study_data.append(temp[0]) study_data.sort(key=lambda x:x[0],reverse=True) sc,w_in_hid,w_hid_out=study_data[0] print("max:"+str(sc))
时间: 2023-05-26 20:05:16 浏览: 268
There seems to be a syntax error in the code. The line 'print("max:" str(sc))' should have a comma to separate the two arguments being printed. Here is the corrected code:
inter_n=10
try_n=1
study_data=[]
for i in range(try_n):
n=neuralNetwork(input_nodes,hidden_nodes,output_nodes,learning_rate)
temp=[]
for j in range(inter_n):
n.train_all()
temp.append((n.test(),n.w_in_hid,n.w_hid_out))
temp.sort(key=lambda x:x[0],reverse=True)
study_data.append(temp[0])
study_data.sort(key=lambda x:x[0],reverse=True)
sc,w_in_hid,w_hid_out=study_data[0]
print("max:", sc)
阅读全文