def test_mnist():
 skip_if_no_gpu()
 train = load_train_file(os.path.join(pylearn2.__path__[0], 'scripts/papers/maxout/mnist.yaml'))
 init_value = control.load_data
 control.load_data = [False]
 train.dataset = MNIST(which_set='train', axes=['c', 0, 1, 'b'], start=0, stop=100)
 train.algorithm._set_monitoring_dataset(train.dataset)
 control.load_data = init_value
 train.algorithm.termination_criterion = EpochCounter(max_epochs=1)
 train.extensions.pop(0)
 train.save_freq = 0
 train.main_loop()

def test_mnist ( ) : skip_if_no_gpu ( ) train = load_train_file ( os . path . join ( pylearn2 . __path__ [ 0 ] , 'scripts/papers/maxout/mnist.yaml' ) ) init_value = control . load_data control . load_data = [ False ] train . dataset = MNIST ( which_set = 'train' , axes = [ 'c' , 0 , 1 , 'b' ] , start = 0 , stop = 100 ) train . algorithm . _set_monitoring_dataset ( train . dataset ) control . load_data = init_value train . algorithm . termination_criterion = EpochCounter ( max_epochs = 1 ) train . extensions . pop ( 0 ) train . save_freq = 0 train . main_loop ( )
test the mnist .