

def test_sample_ae():
    '\n    Visualize some samples from the trained unsupervised GSN.\n    '
    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))

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/scripts/gsn_example.py test_sample_ae/original