def test_classify():
 with open('gsn_sup_example.pkl') as f:
  gsn = pickle.load(f)
 gsn = JointGSN.convert(gsn)
 gsn._corrupt_switch = False
 ds = MNIST(which_set='test')
 mb_data = ds.X
 y = ds.y
 for i in xrange(1, 10):
  y_hat = gsn.classify(mb_data, trials=i)
  errors = (np.abs((y_hat - y)).sum() / 2.0)
  print(i, errors, (errors / mb_data.shape[0]))

def test_classify ( ) : with open ( 'gsn_sup_example.pkl' ) as f : gsn = pickle . load ( f ) gsn = JointGSN . convert ( gsn ) gsn . _corrupt_switch = False ds = MNIST ( which_set = 'test' ) mb_data = ds . X y = ds . y for i in xrange ( 1 , 10 ) : y_hat = gsn . classify ( mb_data , trials = i ) errors = ( np . abs ( ( y_hat - y ) ) . sum ( ) / 2.0 ) print ( i , errors , ( errors / mb_data . shape [ 0 ] ) )
see how well a gsn performs at classification .