mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 06:33:44 +00:00
improve
This commit is contained in:
parent
53b6fe15c9
commit
0e0e75db19
|
@ -49,9 +49,9 @@ class Bpnn():
|
||||||
'''
|
'''
|
||||||
data_train = np.asarray(data_train)
|
data_train = np.asarray(data_train)
|
||||||
data_teach = np.asarray(data_teach)
|
data_teach = np.asarray(data_teach)
|
||||||
print('-------------------Start Training-------------------------')
|
# print('-------------------Start Training-------------------------')
|
||||||
print(' - - Shape: Train_Data ',np.shape(data_train))
|
# print(' - - Shape: Train_Data ',np.shape(data_train))
|
||||||
print(' - - Shape: Teach_Data ',np.shape(data_teach))
|
# print(' - - Shape: Teach_Data ',np.shape(data_teach))
|
||||||
rp = 0
|
rp = 0
|
||||||
all_mse = []
|
all_mse = []
|
||||||
mse = 10000
|
mse = 10000
|
||||||
|
@ -95,9 +95,9 @@ class Bpnn():
|
||||||
plt.ylabel('All_mse')
|
plt.ylabel('All_mse')
|
||||||
plt.grid(True,alpha = 0.7)
|
plt.grid(True,alpha = 0.7)
|
||||||
plt.show()
|
plt.show()
|
||||||
print('------------------Training Complished---------------------')
|
# print('------------------Training Complished---------------------')
|
||||||
print(' - - Training epoch: ', rp, ' - - Mse: %.6f'%mse)
|
# print(' - - Training epoch: ', rp, ' - - Mse: %.6f'%mse)
|
||||||
print(' - - Last Output: ', final_out3)
|
# print(' - - Last Output: ', final_out3)
|
||||||
if draw_e:
|
if draw_e:
|
||||||
draw_error()
|
draw_error()
|
||||||
|
|
||||||
|
@ -108,9 +108,9 @@ class Bpnn():
|
||||||
'''
|
'''
|
||||||
data_test = np.asarray(data_test)
|
data_test = np.asarray(data_test)
|
||||||
produce_out = []
|
produce_out = []
|
||||||
print('-------------------Start Testing-------------------------')
|
# print('-------------------Start Testing-------------------------')
|
||||||
print(' - - Shape: Test_Data ',np.shape(data_test))
|
# print(' - - Shape: Test_Data ',np.shape(data_test))
|
||||||
print(np.shape(data_test))
|
# print(np.shape(data_test))
|
||||||
for g in range(np.shape(data_test)[0]):
|
for g in range(np.shape(data_test)[0]):
|
||||||
|
|
||||||
net_i = data_test[g]
|
net_i = data_test[g]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user