コード例 #1
0
def run():
    parser = GooeyParser()
    subs = parser.add_subparsers(help='commands', dest='commands')

    train_parser = subs.add_parser('train', help='Configurate model training')
    param_group = train_parser.add_argument_group("Model parameter option", gooey_options={'show_border': True, 'columns': 2})
    args_param.add(param_group)
    data_group = train_parser.add_argument_group("Data Options", gooey_options={'show_border': True}, )
    args_data.add(data_group)
    save_group = train_parser.add_argument_group("Save option", gooey_options={'show_border': True, 'columns': 2})
    args_save.add(save_group)


    test_parser = subs.add_parser('test', help='Configurate model testining')
    data_group = test_parser.add_argument_group("Data Options", gooey_options={'show_border': True}, )
    args_data.add(data_group)
    load_group = test_parser.add_argument_group("Load option", gooey_options={'show_border': True, 'columns': 1})
    args_load.add(load_group, model_savefiles())
    save_group = test_parser.add_argument_group("Save option", gooey_options={'show_border': True, 'columns': 2})
    args_save.add(save_group)

    args = parser.parse_args()
    X, Y = load_data(args.data_path)

    if args.commands =='train':
        train(args, X, Y, save_dir)
    else:
        with open(save_dir + args.load_model, 'rb') as f:
            model = pickle.load(f)
        test(args, X, Y, save_dir, model)
コード例 #2
0
def run():
    parser = GooeyParser()
    subs = parser.add_subparsers(help='commands', dest='commands')

    train_parser = subs.add_parser('train', help='Configurate model training')
    param_group = train_parser.add_argument_group("Model parameter option", gooey_options={'show_border': True, 'columns': 2})
    param_group = args_param.add(param_group)
    data_group = train_parser.add_argument_group("Data Options", gooey_options={'show_border': True, 'columns': 1})
    data_group = args_data.add(data_group)
    save_group = train_parser.add_argument_group("Save option", gooey_options={'show_border': True, 'columns': 1})
    save_group = args_save.add(save_group)


    test_parser = subs.add_parser('test', help='Configurate model testing')
    data_group = test_parser.add_argument_group("Data Options", gooey_options={'show_border': True}, )
    data_group = args_data.add(data_group)
    pretrained_group = test_parser.add_argument_group("Pretrained file Options", gooey_options={'show_border': True}, )
    pretrained_group = args_pre.add(pretrained_group)


    args = parser.parse_args()

    if args.commands =='train':
        train.train(args)
    else:
        test.test(args)
コード例 #3
0
def run():
    parser = GooeyParser()
    subs = parser.add_subparsers(help='commands', dest='commands')

    train_parser = subs.add_parser('train', help='Training Configuration')
    param_group = train_parser.add_argument_group("Model",
                                                  gooey_options={
                                                      'show_border': True,
                                                      'columns': 2
                                                  })
    param_group = args_train.add(param_group)
    data_group = train_parser.add_argument_group(
        "Data",
        gooey_options={'show_border': True},
    )
    data_group = args_data.add(data_group)

    test_parser = subs.add_parser('test', help='Test Configuration')
    log_group = test_parser.add_argument_group("Files",
                                               gooey_options={
                                                   'show_border': True,
                                                   'columns': 1
                                               })
    log_parser = args_test.add(log_group)
    data_group = test_parser.add_argument_group(
        "Data",
        gooey_options={'show_border': True},
    )
    data_group = args_data.add(data_group)

    print(param_group)
    print(data_group)
    print(log_group)

    args = parser.parse_args()
    print(args)

    if args.commands == 'train':
        train.do(args)
    else:
        test.do(args)