1515 Date: 2017.9.20
1616 - - - - - -- - - - - - - - - - - - - - - - - - - - - - -
1717 '''
18+ from __future__ import print_function
1819
1920import numpy as np
2021import matplotlib .pyplot as plt
@@ -192,8 +193,8 @@ def _calculate_gradient_from_pool(self,out_map,pd_pool,num_map,size_map,size_poo
192193 def trian (self ,patterns ,datas_train , datas_teach , n_repeat , error_accuracy ,draw_e = bool ):
193194 #model traning
194195 print ('----------------------Start Training-------------------------' )
195- print (' - - Shape: Train_Data ' ,np .shape (datas_train ))
196- print (' - - Shape: Teach_Data ' ,np .shape (datas_teach ))
196+ print (( ' - - Shape: Train_Data ' ,np .shape (datas_train ) ))
197+ print (( ' - - Shape: Teach_Data ' ,np .shape (datas_teach ) ))
197198 rp = 0
198199 all_mse = []
199200 mse = 10000
@@ -262,7 +263,7 @@ def draw_error():
262263 plt .grid (True , alpha = 0.5 )
263264 plt .show ()
264265 print ('------------------Training Complished---------------------' )
265- print (' - - Training epoch: ' , rp , ' - - Mse: %.6f' % mse )
266+ print (( ' - - Training epoch: ' , rp , ' - - Mse: %.6f' % mse ) )
266267 if draw_e :
267268 draw_error ()
268269 return mse
@@ -271,7 +272,7 @@ def predict(self,datas_test):
271272 #model predict
272273 produce_out = []
273274 print ('-------------------Start Testing-------------------------' )
274- print (' - - Shape: Test_Data ' ,np .shape (datas_test ))
275+ print (( ' - - Shape: Test_Data ' ,np .shape (datas_test ) ))
275276 for p in range (len (datas_test )):
276277 data_test = np .asmatrix (datas_test [p ])
277278 data_focus1 , data_conved1 = self .convolute (data_test , self .conv1 , self .w_conv1 ,
0 commit comments