Example #1
0
def read_arguments(train=True):
    parser = argparse.ArgumentParser()
    parser = add_all_arguments(parser, train)
    parser.add_argument('--phase', type=str, default='train')
    opt = parser.parse_args()
    if train:
        set_dataset_default_lm(opt, parser)
        if opt.continue_train:
            update_options_from_file(opt, parser)
    opt = parser.parse_args()
    opt.phase = 'train' if train else 'test'
    if train:
        opt.loaded_latest_iter = 0 if not opt.continue_train else load_iter(opt)
    utils.fix_seed(opt.seed)
    print_options(opt, parser)
    if train:
        save_options(opt, parser)
    return opt
Example #2
0
def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument('--submit', type=str, default="False")
    args = parser.parse_args()
    args.submit = (args.submit == 'True')
    return args


args = parse_args()

if __name__ == "__main__":

    # hyper params
    seed = 1
    fix_seed(seed)

    n_folds = 5
    epochs = 200
    batch_size = 512

    # data
    train_df, test_df, sample_submit_df = load_dataset()
    X, X_test = glove(train_df, test_df)

    X = X.values.astype('float32')
    X_test = X_test.values.astype('float32')
    y = pd.get_dummies(train_df['jobflag']).values.astype('float32')

    trainset = JobInfoDataset(X, y, jobflag=train_df['jobflag'].values)
    testset = JobInfoDataset(X_test)
Example #3
0
from utils.utils import fix_seed
from utils.observer import get_current_time

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument('--submit', type=str, default="False")
    args = parser.parse_args()
    args.submit = (args.submit == 'True')
    return args

args = parse_args()

if __name__ == "__main__":

    # hyper params
    seed=1; fix_seed(seed)

    n_folds = 5
    epochs = 600
    batch_size = 512

    # data
    train_df, test_df, sample_submit_df = load_dataset()
    X, X_test = word2vec(train_df, test_df)

    X = X.values.astype('float32')
    X_test = X_test.values.astype('float32')
    y = pd.get_dummies(train_df['jobflag']).values.astype('float32')

    trainset = JobInfoDataset(X, y, jobflag=train_df['jobflag'].values)
    testset = JobInfoDataset(X_test)