Exemplo n.º 1
0
DEFINE_integer("num_epochs", 300, "")
DEFINE_integer("child_lr_dec_every", 100, "")
DEFINE_integer("child_num_layers", 5, "")
DEFINE_integer("child_num_cells", 5, "")
DEFINE_integer("child_filter_size", 5, "")
DEFINE_integer("child_out_filters", 48, "")
DEFINE_integer("child_out_filters_scale", 1, "")
DEFINE_integer("child_num_branches", 4, "")
DEFINE_integer("child_num_aggregate", None, "")
DEFINE_integer("child_num_replicas", 1, "")
DEFINE_integer("child_block_size", 3, "")
DEFINE_integer("child_lr_T_0", None, "for lr schedule")
DEFINE_integer("child_lr_T_mul", None, "for lr schedule")
DEFINE_integer("child_cutout_size", None, "CutOut size")
DEFINE_float("child_grad_bound", 5.0, "Gradient clipping")
DEFINE_float("child_lr", 0.1, "")
DEFINE_float("child_lr_dec_rate", 0.1, "")
DEFINE_float("child_keep_prob", 0.5, "")
DEFINE_float("child_drop_path_keep_prob", 1.0, "minimum drop_path_keep_prob")
DEFINE_float("child_l2_reg", 1e-4, "")
DEFINE_float("child_lr_max", None, "for lr schedule")
DEFINE_float("child_lr_min", None, "for lr schedule")
DEFINE_string("child_skip_pattern", None, "Must be ['dense', None]")
DEFINE_string("child_fixed_arc", None, "")
DEFINE_boolean("child_use_aux_heads", False, "Should we use an aux head")
DEFINE_boolean("child_sync_replicas", False, "To sync or not to sync.")
DEFINE_boolean("child_lr_cosine", False, "Use cosine lr schedule")

DEFINE_float("controller_lr", 1e-3, "")
DEFINE_float("controller_lr_dec_rate", 1.0, "")
Exemplo n.º 2
0
flags = tf.app.flags
FLAGS = flags.FLAGS

DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.")
DEFINE_string("data_path", "", "")
DEFINE_string("output_dir", "", "")
DEFINE_string("search_for", None, "[rhn|base|enas]")

DEFINE_string("child_fixed_arc", None, "")
DEFINE_integer("batch_size", 25, "")
DEFINE_integer("child_base_number", 4, "")
DEFINE_integer("child_num_layers", 2, "")
DEFINE_integer("child_bptt_steps", 20, "")
DEFINE_integer("child_lstm_hidden_size", 200, "")
DEFINE_float("child_lstm_e_keep", 1.0, "")
DEFINE_float("child_lstm_x_keep", 1.0, "")
DEFINE_float("child_lstm_h_keep", 1.0, "")
DEFINE_float("child_lstm_o_keep", 1.0, "")
DEFINE_boolean("child_lstm_l_skip", False, "")
DEFINE_float("child_lr", 1.0, "")
DEFINE_float("child_lr_dec_rate", 0.5, "")
DEFINE_float("child_grad_bound", 5.0, "")
DEFINE_float("child_temperature", None, "")
DEFINE_float("child_l2_reg", None, "")
DEFINE_float("child_lr_dec_min", None, "")
DEFINE_float("child_optim_moving_average", None,
             "Use the moving average of Variables")
DEFINE_float("child_rnn_l2_reg", None, "")
DEFINE_float("child_rnn_slowness_reg", None, "")
DEFINE_float("child_lr_warmup_val", None, "")
Exemplo n.º 3
0
flags = tf.app.flags
FLAGS = flags.FLAGS

DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.")
DEFINE_string("data_path", "", "")
DEFINE_string("output_dir", "", "")
DEFINE_string("search_for", None, "[rhn|base|enas]")

DEFINE_string("child_fixed_arc", None, "")
DEFINE_integer("batch_size", 25, "")
DEFINE_integer("child_base_number", 4, "")
DEFINE_integer("child_num_layers", 2, "")
DEFINE_integer("child_bptt_steps", 20, "")
DEFINE_integer("child_lstm_hidden_size", 200, "")
DEFINE_float("child_lstm_e_keep", 1.0, "")
DEFINE_float("child_lstm_x_keep", 1.0, "")
DEFINE_float("child_lstm_h_keep", 1.0, "")
DEFINE_float("child_lstm_o_keep", 1.0, "")
DEFINE_boolean("child_lstm_l_skip", False, "")
DEFINE_float("child_lr", 1.0, "")
DEFINE_float("child_lr_dec_rate", 0.5, "")
DEFINE_float("child_grad_bound", 5.0, "")
DEFINE_float("child_temperature", None, "")
DEFINE_float("child_l2_reg", None, "")
DEFINE_float("child_lr_dec_min", None, "")
DEFINE_float("child_optim_moving_average", None,
             "Use the moving average of Variables")
DEFINE_float("child_rnn_l2_reg", None, "")
DEFINE_float("child_rnn_slowness_reg", None, "")
DEFINE_float("child_lr_warmup_val", None, "")
Exemplo n.º 4
0
def macro_init():
    DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.")
    DEFINE_string("output_dir", "", "")
    DEFINE_string("search_for", "macro", "Must be [macro|micro]")

    DEFINE_integer("batch_size", 128, "")
    DEFINE_integer("num_epochs", 310, "")
    DEFINE_integer("train_data_size", 45000, "")

    DEFINE_integer("child_num_layers", 12, "")
    DEFINE_integer("child_num_branches", 6, "")
    DEFINE_integer("child_out_filters", 36, "")
    DEFINE_integer("child_num_cells", 5, "")

    DEFINE_float("controller_lr", 0.001, "")
    DEFINE_float("controller_lr_dec_rate", 1.0, "")
    DEFINE_float("controller_keep_prob", 0.5, "")
    DEFINE_float("controller_l2_reg", 0.0, "")
    DEFINE_float("controller_bl_dec", 0.99, "")
    DEFINE_float("controller_tanh_constant", 1.5, "")
    DEFINE_float("controller_op_tanh_reduce", 2.5, "")
    DEFINE_float("controller_entropy_weight", 0.0001, "")
    DEFINE_float("controller_skip_target", 0.4, "")
    DEFINE_float("controller_skip_weight", 0.8, "")
    DEFINE_float("controller_temperature", None, "")
    DEFINE_integer("controller_num_aggregate", 20, "")
    DEFINE_integer("controller_num_replicas", 1, "")
    DEFINE_integer("controller_train_steps", 50, "")
    DEFINE_integer("controller_forwards_limit", 2, "")
    DEFINE_integer("controller_train_every", 1,
                   "train the controller after this number of epochs")
    DEFINE_boolean("controller_search_whole_channels", True, "")
    DEFINE_boolean("controller_sync_replicas", False,
                   "To sync or not to sync.")
    DEFINE_boolean("controller_training", True, "")
    DEFINE_boolean("controller_use_critic", False, "")

    DEFINE_integer("log_every", 50, "How many steps to log")
    DEFINE_integer("eval_every_epochs", 1, "How many epochs to eval")

    DEFINE_string("tuner_class_name", "", "")
    DEFINE_string("tuner_class_filename", "", "")
    DEFINE_string("tuner_args", "", "")
    DEFINE_string("tuner_directory", "", "")
    DEFINE_string("assessor_class_name", "", "")
    DEFINE_string("assessor_args", "", "")
    DEFINE_string("assessor_directory", "", "")
    DEFINE_string("assessor_class_filename", "", "")
    DEFINE_boolean("multi_phase", True, "")
    DEFINE_boolean("multi_thread", True, "")
Exemplo n.º 5
0
# parameters for result, in/out data
DEFINE_boolean("reset_output_dir", True, "Delete output_dir if exists.")
DEFINE_string("data_path", "../tfrecord/",
              "path of train,valid tfrecord folder")
DEFINE_string("img_path", "../data/", "path of test image folder")
DEFINE_string("data_format", "NHWC", "image data format. 'NHWC' or 'NCHW'")
DEFINE_string("output_dir", "./outputs/fixed_small_cb_x4", "path of result")
DEFINE_string("checkpoint", "model.ckpt-931000", "path of checkpoint file")
DEFINE_string("checkpoint_dir", "./outputs/x2", "path of checkpoint file")

DEFINE_boolean("test_mode", False, "use when test")
DEFINE_boolean("inference_mode", False, "use when inference")
DEFINE_string("use_model", None, "which model to use for training")
DEFINE_boolean("rl_search", False, "use global/local feature fusion searching")
DEFINE_boolean("cb_reward", True, "use complexity based reward")
DEFINE_float("cb_rate", 2, "rate of complexity based reward")

# parameters for batch and training
DEFINE_integer("batch_size", 4, "batch size in training process")
DEFINE_integer("num_epochs", 600, "training epoch for child_network")
DEFINE_integer("it_per_epoch", 1000, "iteration of 1 epoch for child_network")
DEFINE_integer("eval_batch_size", 20, "batch size of evaluation process")
DEFINE_integer("test_batch_size", 1, "batch size of test process")
DEFINE_integer("loss_cut", 2,
               "cut training process when loss > avgLoss*loss_cut")
DEFINE_boolean("image_random", False, "use when test")
DEFINE_boolean("channel_attn", True, "use channel_attn method or not")

# parameters for child_network design
DEFINE_integer("child_upsample_size", 2, "rate of lr image size")
DEFINE_integer("child_num_layers", 4, "number of Cells")
Exemplo n.º 6
0
DEFINE_integer("num_epochs", 300, "")
DEFINE_integer("child_lr_dec_every", 100, "")
DEFINE_integer("child_num_layers", 5, "")
DEFINE_integer("child_num_cells", 5, "")
DEFINE_integer("child_filter_size", 5, "")
DEFINE_integer("child_out_filters", 48, "")
DEFINE_integer("child_out_filters_scale", 1, "")
DEFINE_integer("child_num_branches", 4, "")
DEFINE_integer("child_num_aggregate", None, "")
DEFINE_integer("child_num_replicas", 1, "")
DEFINE_integer("child_block_size", 3, "")
DEFINE_integer("child_lr_T_0", None, "for lr schedule")
DEFINE_integer("child_lr_T_mul", None, "for lr schedule")
DEFINE_integer("child_cutout_size", None, "CutOut size")
DEFINE_float("child_grad_bound", 5.0, "Gradient clipping")
DEFINE_float("child_lr", 0.1, "")
DEFINE_float("child_lr_dec_rate", 0.1, "")
DEFINE_float("child_keep_prob", 0.5, "")
DEFINE_float("child_drop_path_keep_prob", 1.0, "minimum drop_path_keep_prob")
DEFINE_float("child_l2_reg", 1e-4, "")
DEFINE_float("child_lr_max", None, "for lr schedule")
DEFINE_float("child_lr_min", None, "for lr schedule")
DEFINE_string("child_skip_pattern", None, "Must be ['dense', None]")
DEFINE_string("child_fixed_arc", None, "")
DEFINE_boolean("child_use_aux_heads", False, "Should we use an aux head")
DEFINE_boolean("child_sync_replicas", False, "To sync or not to sync.")
DEFINE_boolean("child_lr_cosine", False, "Use cosine lr schedule")
DEFINE_integer("log_every", 50, "How many steps to log")
DEFINE_integer("eval_every_epochs", 1, "How many epochs to eval")
Exemplo n.º 7
0

DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.")
DEFINE_string("output_dir", "", "")
DEFINE_string("search_for", "macro", "Must be [macro|micro]")

DEFINE_integer("batch_size", 128, "")
DEFINE_integer("num_epochs", 310, "")
DEFINE_integer("train_data_size", 45000, "")

DEFINE_integer("child_num_layers", 12, "")
DEFINE_integer("child_num_branches", 6, "")
DEFINE_integer("child_out_filters", 36, "")
DEFINE_integer("child_num_cells", 5, "")

DEFINE_float("controller_lr", 0.001, "")
DEFINE_float("controller_lr_dec_rate", 1.0, "")
DEFINE_float("controller_keep_prob", 0.5, "")
DEFINE_float("controller_l2_reg", 0.0, "")
DEFINE_float("controller_bl_dec", 0.99, "")
DEFINE_float("controller_tanh_constant", 1.5, "")
DEFINE_float("controller_op_tanh_reduce", 2.5, "")
DEFINE_float("controller_entropy_weight", 0.0001, "")
DEFINE_float("controller_skip_target", 0.4, "")
DEFINE_float("controller_skip_weight", 0.8, "")
DEFINE_float("controller_temperature", None, "")
DEFINE_integer("controller_num_aggregate", 20, "")
DEFINE_integer("controller_num_replicas", 1, "")
DEFINE_integer("controller_train_steps", 50, "")
DEFINE_integer("controller_forwards_limit", 2, "")
DEFINE_integer("controller_train_every", 1,
flags = tf.app.flags
FLAGS = flags.FLAGS

DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.")
DEFINE_string("data_path", None, "Path to CIFAR-10 data")
DEFINE_string("output_dir", "output", "Path to log folder")

DEFINE_string("model_name", "",
              "Name of the method. [feed_forward|conv]")

DEFINE_integer("log_every", 10, "How many steps to log")
DEFINE_integer("num_classes", 10, "Number of classes")
DEFINE_integer("train_batch_size", 256, "Size of training batches")
DEFINE_integer("eval_batch_size", 100, "Size of testing batches")
DEFINE_float("l2_reg", 1e-4, "L2 regularization rate")
DEFINE_float("learning_rate", 0.05, "Learning rate")
DEFINE_integer("train_steps", 6000, "Number of training steps")

def get_ops(images, labels):
  """Builds the model."""

  print("-" * 80)
  print("Creating a '{0}' model".format(FLAGS.model_name))
  if FLAGS.model_name == "feed_forward":
    ops = feed_forward_net(images, labels, FLAGS)
  elif FLAGS.model_name == "conv":
    ops = conv_net(images, labels, FLAGS)
  else:
    raise ValueError("Unknown model name '{0}'".format(FLAGS.model_name))