def define_mnist_eager_flags(): """Defined flags and defaults for MNIST in eager mode.""" flags_core.define_base_eager() flags_core.define_image() flags.adopt_module_key_flags(flags_core) flags.DEFINE_integer( name='log_interval', short_name='li', default=10, help=flags_core.help_wrap('batches between logging training status')) flags.DEFINE_string( name='output_dir', short_name='od', default=None, help=flags_core.help_wrap('Directory to write TensorBoard summaries')) flags.DEFINE_float(name='learning_rate', short_name='lr', default=0.01, help=flags_core.help_wrap('Learning rate.')) flags.DEFINE_float(name='momentum', short_name='m', default=0.5, help=flags_core.help_wrap('SGD momentum.')) flags.DEFINE_bool(name='no_gpu', short_name='nogpu', default=False, help=flags_core.help_wrap( 'disables GPU usage even if a GPU is available')) flags_core.set_defaults( data_dir='/tmp/tensorflow/mnist/input_data', model_dir='/tmp/tensorflow/mnist/checkpoints/', batch_size=100, train_epochs=10, )
def define_mnist_eager_flags(): """Defined flags and defaults for MNIST in eager mode.""" flags_core.define_base_eager() flags_core.define_image() flags.adopt_module_key_flags(flags_core) flags.DEFINE_integer( name='log_interval', short_name='li', default=10, help=flags_core.help_wrap('batches between logging training status')) flags.DEFINE_string( name='output_dir', short_name='od', default=None, help=flags_core.help_wrap('Directory to write TensorBoard summaries')) flags.DEFINE_float(name='learning_rate', short_name='lr', default=0.01, help=flags_core.help_wrap('Learning rate.')) flags.DEFINE_float(name='momentum', short_name='m', default=0.5, help=flags_core.help_wrap('SGD momentum.')) flags.DEFINE_bool(name='no_gpu', short_name='nogpu', default=False, help=flags_core.help_wrap( 'disables GPU usage even if a GPU is available')) flags_core.set_defaults( data_dir='/tmp/tensorflow/mnist/input_data', model_dir='/tmp/tensorflow/mnist/checkpoints/', batch_size=100, train_epochs=10, )