

def test_classify():
    '\n    See how well a (supervised) GSN performs at classification.\n    '
    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(y, errors, (errors / mb_data.shape[0]))

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/scripts/gsn_example.py test_classify/VarMisuse@115/181 `i`->`y`