def test_sample_ae():
 with open('gsn_ae_example.pkl') as f:
  gsn = pickle.load(f)
 mb_data = MNIST(which_set='test').X[105:106, :]
 history = gsn.get_samples([(0, mb_data)], walkback=1000, symbolic=False, include_first=True)
 history = list(itertools.chain(*history))
 history = np.vstack(history)
 tiled = image.tile_raster_images(history, img_shape=[28, 28], tile_shape=[50, 50], tile_spacing=(2, 2))
 image.save('gsn_ae_example.png', tiled)
 pw = ParzenWindows(MNIST(which_set='test').X, 0.2)
 print(pw.get_ll(history))

def test_sample_ae ( ) : with open ( 'gsn_ae_example.pkl' ) as f : gsn = pickle . load ( f ) mb_data = MNIST ( which_set = 'test' ) . X [ 105 : 106 , : ] history = gsn . get_samples ( [ ( 0 , mb_data ) ] , walkback = 1000 , symbolic = False , include_first = True ) history = list ( itertools . chain ( * history ) ) history = np . vstack ( history ) tiled = image . tile_raster_images ( history , img_shape = [ 28 , 28 ] , tile_shape = [ 50 , 50 ] , tile_spacing = ( 2 , 2 ) ) image . save ( 'gsn_ae_example.png' , tiled ) pw = ParzenWindows ( MNIST ( which_set = 'test' ) . X , 0.2 ) print ( pw . get_ll ( history ) )
visualize some samples from the trained unsupervised gsn .