Ejemplo n.º 1
0
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, "")
DEFINE_integer("num_epochs", 630, " = (10 + 20 + 40 + 80 + 160 +320)")

DEFINE_integer("child_lr_dec_every", 100, "")
DEFINE_integer(
    "child_num_layers", 15,
    "Number of layer. IN this case we will calculate 4 conv and 2 pooling layers"
)
DEFINE_integer("child_num_cells", 5,
               "child_num_cells +2 = Number of DAG'S Nodes")
DEFINE_integer("child_filter_size", 5, "")
DEFINE_integer("child_out_filters", 16, "")
Ejemplo n.º 2
0
from data_utils import create_batched_dataset
from data_utils import sentence_to_tensor
from models import model

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,"