I am reading some example codes in Tensorflow, I found following code
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_float('learning_rate', 0.01, 'Initial learning rate.')
flags.DEFINE_integer('max_steps', 2000, 'Number of steps to run trainer.')
flags.DEFINE_integer('hidden1', 128, 'Number of units in hidden layer 1.')
flags.DEFINE_integer('hidden2', 32, 'Number of units in hidden layer 2.')
flags.DEFINE_integer('batch_size', 100, 'Batch size. '
'Must divide evenly into the dataset sizes.')
flags.DEFINE_string('train_dir', 'data', 'Directory to put the training data.')
flags.DEFINE_boolean('fake_data', False, 'If true, uses fake data '
'for unit testing.')
in tensorflow/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py
But I can't find any docs about this usage of tf.app.flags
.
And I found the implementation of this flags is in the
tensorflow/tensorflow/python/platform/default/_flags.py
Obviously, this tf.app.flags
is somehow used to configure a network, so why is it not in the API docs? Can anyone explain what is going on here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…