Python datasets.mnist() Examples

The following are 1 code examples of datasets.mnist(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module datasets , or try the search function .
Example #1
Source File: vgg_train.py    From keras-deepcv with MIT License 4 votes vote down vote up
def parse_args():
	"""
	Parse command line arguments.

	Parameters:
		None
	Returns:
		parser arguments
	"""
	parser = argparse.ArgumentParser(description='LeNet model')
	optional = parser._action_groups.pop()
	required = parser.add_argument_group('required arguments')
	required.add_argument('--net',
		dest='net',
		help='Choice of network architecture',
		choices=['vgg16', 'vgg19'])
	optional.add_argument('--dataset',
		dest='dataset',
		help='Choice of dataset to train model',
		choices=[None, 'mnist', 'cifar10'],
		default=None)
	optional.add_argument('--print_model',
		dest='print_model',
		help='Print LeNet model',
		action='store_true')
	optional.add_argument('--train_model',
		dest='train_model',
		help='Train LeNet on MNIST',
		action='store_true')
	optional.add_argument('-s', '--save_weights',
		dest='save_weights',
		help='Save the trained weights',
		default=None)
	optional.add_argument('-w', '--weights',
		dest='weights',
		help='Path to weights (hdf5) file',
		default=None)
	optional.add_argument('-e', '--epochs',
		dest='epochs',
		help='Number of epochs for training',
		type=int,
		default=20)
	optional.add_argument('--data_augmentation',
		dest='data_augmentation',
		help='Use data augmentations for input',
		action='store_true')
	optional.add_argument('--viz_training',
		dest='viz_training',
		help='Visualize the training curve',
		action='store_true')
	parser._action_groups.append(optional)
	return parser.parse_args()