from utils import DEFINE_boolean from utils import DEFINE_float from utils import DEFINE_integer from utils import DEFINE_string from utils import print_user_flags import data_utils from micro_controller import MicroController from micro_child import MicroChild flags = tf.app.flags FLAGS = flags.FLAGS ################## YOU Should write under parameter ###################### DEFINE_string("output_dir", "./output", "") DEFINE_string("train_data_dir", "./data/train", "") DEFINE_string("val_data_dir", "./data/valid", "") DEFINE_string("test_data_dir", "./data/test", "") DEFINE_integer("channel", 1, "MNIST: 1, Cifar10: 3") DEFINE_integer("img_size", 32, "enlarge image size") DEFINE_integer("n_aug_img", 1, "if 2: num_img: 55000 -> aug_img: 110000, elif 1: False") DEFINE_float("child_lr_min", 0.00005, "for lr schedule") ########################################################################## DEFINE_boolean("reset_output_dir", True, "Delete output_dir if exists.") DEFINE_string("data_format", "NHWC", "'NHWC or NCHW'") DEFINE_string("search_for", "micro", "") DEFINE_integer("batch_size", 160, "")
from path_generator import PathGenerator from dag_executor import DagExecutor from dag_generator import DagGenerator from dag_controller import DagController import data_utils from data_utils import read_data flags = tf.app.flags FLAGS = flags.FLAGS os.environ['CUDA_VISIBLE_DEVICES'] = '1' logger = utils.logger DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.") DEFINE_string("data_path", "", "") DEFINE_string("output_dir", "", "") DEFINE_string("summaries_dir", "", "") DEFINE_string("data_format", "NHWC", "'NHWC' or 'NCWH'") DEFINE_string("search_for", None, "Must be [macro|micro]") DEFINE_integer("num_gpus", 1, "") DEFINE_integer("num_cpus", 1, "") DEFINE_integer("batch_size", 32, "") DEFINE_integer("num_epochs_evolve", 3, "") DEFINE_integer("num_epochs", 300, "") DEFINE_integer("child_lr_dec_every", 100, "") DEFINE_integer("child_num_layers", 5, "") DEFINE_integer("child_num_cells", 8, "")
from utils import DEFINE_boolean from utils import DEFINE_integer from utils import DEFINE_string from utils import DEFINE_float from utils import print_user_flags from utils import loss_function from utils import plot_attention_map flags = tf.app.flags FLAGS = flags.FLAGS DEFINE_boolean("reset_output_dir", False, "Delete output_dir if exists.") DEFINE_boolean("restore_checkpoint", True, "Auto retrieve checkpoint or not.") DEFINE_boolean("is_toy", False, "Toy Dataset or not, useful for debugging") DEFINE_boolean("is_attention", False, "Using Attention for Decoder or not") DEFINE_string("data_path", "en-es", "Path to parallel corpus data (.txt)") DEFINE_string("output_dir", "output", "Path to log folder") DEFINE_string("cell_type", "gru", "GRU or LSTM or naive, ...") DEFINE_integer("n_epochs", 10, "Number of training epochs") DEFINE_integer("n_layers", 1, "Number of stacked RNN layers") DEFINE_integer("n_hidden", 1024, "Dimensionality of RNN output") DEFINE_integer("emb_dim", 256, "Dimensionality of word embedding, src==tgt") DEFINE_integer("save_every", 500, "How many batches to save once") DEFINE_integer("eval_every", 100, "How many batches to evaluate") DEFINE_integer("batch_size", 64, "Batch size. SET to `2` for easy debugging.") DEFINE_integer("n_loaded_sentences", 20000, "Number of sentences to load, " "Set to <= 0 for loading all data," "SET LOWER FOR DEBUGGING") DEFINE_float("init_lr", 1e-3, "Init learning rate. This is default for Adam.") DEFINE_float("drop_keep_prob", 1.0, "Dropout rate")
from utils import DEFINE_bool from utils import DEFINE_float from utils import DEFINE_integer from utils import DEFINE_string from utils import print_user_flags os.environ['CUDA_VISIBLE_DEVICES'] = '1' logger = utils.logger flags = tf.flags FLAGS = flags.FLAGS ## Required parameters DEFINE_string( "data_dir", None, "The input data dir. Should contain the .tsv files (or other data files) " "for the task.") DEFINE_string( "bert_config_file", None, "The config json file corresponding to the pre-trained BERT model. " "This specifies the model architecture.") DEFINE_string("task_name", None, "The name of the task to train.") DEFINE_string("vocab_file", None, "The vocabulary file that the BERT model was trained on.") DEFINE_string( "output_dir", None, "The output directory where the model checkpoints will be written.")