Example #1
0
def main(arg, min_edge_distance=0.5, max_edge_distance=1.5):
    dataset_param = arg2dataset_param(arg[0])
    model_param = arg2model_param(arg[1])
    test_dataset_param = arg2dataset_param(arg[2])
    layer_num = None if len(arg) <= 3 else int(arg[3])

    dataset_param.size = 100000
    dataset_param.min_num_node = 4
    dataset_param.num_num_node = 30
    test_dataset_param.size = 1000
    test_dataset_param.min_num_node = 4
    test_dataset_param.num_num_node = 30
    test_dataset_param.min_edge_distance = min_edge_distance
    test_dataset_param.max_edge_distance = max_edge_distance

    metric_name_list = get_metric_names(test_dataset_param.dataset_name)
    test_model(dataset_param,
               model_param,
               test_dataset_param,
               batch_size=max(
                   min(
                       int(16 * 1000 / test_dataset_param.min_num_node * 10 /
                           (layer_num or model_param.layer_num)), 50), 1),
               metric_name_list=metric_name_list,
               layer_num=layer_num)
Example #2
0
def main(arg):
    dataset_param = arg2dataset_param(arg[0])
    model_param = arg2model_param(arg[1])
    test_dataset_param = arg2dataset_param(arg[2])
    layer_num = int(arg[3])
    model_path = arg[4]
    print(model_path)

    dataset_param.size = 100000
    dataset_param.min_num_node = 4
    dataset_param.num_num_node = 30
    test_dataset_param.size = 1000
    metric_name_list = get_metric_names(test_dataset_param.dataset_name)

    test_model(model_path,
               dataset_param, model_param, test_dataset_param,
               batch_size=max(min(int(16*1000/test_dataset_param.min_num_node
                                      *10/(layer_num or model_param.layer_num)), 50), 1),
               metric_name_list=metric_name_list, layer_num=layer_num)
Example #3
0
def main(args):
    test_dataset_param = arg2dataset_param(args.test_dataset_param)
    test_dataset_param.size = 1000
    if not args.metric:
        metric_name_list = get_metric_names(test_dataset_param.dataset_name)
    else:
        metric_name_list = args.metric

    best_parameters(test_dataset_param,
                    metric_name_list=metric_name_list,
                    keys=args.key,
                    no_keys=args.no_key)
Example #4
0
def main(arg):
    dataset_param = arg2dataset_param(arg[0])
    model_param = arg2model_param(arg[1])
    resume_flag = len(arg) > 2

    dataset_param.size = 100000
    dataset_param.min_num_node = 4
    dataset_param.num_num_node = 30
    general_param = get_general_param()
    general_param.save_freq = int(general_param.save_freq*10000/dataset_param.size)
    general_param.epoch_num = int(general_param.epoch_num*10000*2/dataset_param.size)
    general_param.resume_flag = resume_flag

    train_model(dataset_param, model_param, general_param)