def makeMnistDataSets(path):
 test = SupervisedDataSet((28 * 28), 10)
 test_image_file = os.path.join(path, 't10k-images-idx3-ubyte')
 test_label_file = os.path.join(path, 't10k-labels-idx1-ubyte')
 test_images = images(test_image_file)
 test_labels = (flaggedArrayByIndex(l, 10) for l in labels(test_label_file))
 for (image, label) in zip(test_images, test_labels):
  test.addSample(image, label)
 train = SupervisedDataSet((28 * 28), 10)
 train_image_file = os.path.join(path, 'train-images-idx3-ubyte')
 train_label_file = os.path.join(path, 'train-labels-idx1-ubyte')
 train_images = images(train_image_file)
 train_labels = (flaggedArrayByIndex(l, 10) for l in labels(train_label_file))
 for (image, label) in zip(train_images, train_labels):
  train.addSample(image, label)
 return (train, test)

def makeMnistDataSets ( path ) : test = SupervisedDataSet ( ( 28 * 28 ) , 10 ) test_image_file = os . path . join ( path , 't10k-images-idx3-ubyte' ) test_label_file = os . path . join ( path , 't10k-labels-idx1-ubyte' ) test_images = images ( test_image_file ) test_labels = ( flaggedArrayByIndex ( l , 10 ) for l in labels ( test_label_file ) ) for ( image , label ) in zip ( test_images , test_labels ) : test . addSample ( image , label ) train = SupervisedDataSet ( ( 28 * 28 ) , 10 ) train_image_file = os . path . join ( path , 'train-images-idx3-ubyte' ) train_label_file = os . path . join ( path , 'train-labels-idx1-ubyte' ) train_images = images ( train_image_file ) train_labels = ( flaggedArrayByIndex ( l , 10 ) for l in labels ( train_label_file ) ) for ( image , label ) in zip ( train_images , train_labels ) : train . addSample ( image , label ) return ( train , test )
return a pair consisting of two datasets .