示例#1
0
def main(args):

    # create output dir
    out_dir = os.path.join(args.out_dir,
                           args.dataset,
                           args.criterion,
                           args.method,
                           'rs_{}'.format(args.rs))

    log_fp = os.path.join(out_dir, 'log.txt')
    os.makedirs(out_dir, exist_ok=True)

    # skip experiment if results already exist
    if args.append_results and os.path.exists(os.path.join(out_dir, 'results.npy')):
        return

    # create logger
    logger = print_util.get_logger(log_fp)
    logger.info(args)
    logger.info(datetime.now())

    # run experiment
    experiment(args, logger, out_dir)

    # remove logger
    print_util.remove_logger(logger)
示例#2
0
def main(args):

    # make logger
    dataset = args.dataset

    out_dir = os.path.join(args.out_dir, dataset, args.tree_type, args.tree_kernel)
    os.makedirs(out_dir, exist_ok=True)

    logger = print_util.get_logger(os.path.join(out_dir, 'log.txt'))
    logger.info(args)

    experiment(args, logger, out_dir, seed=args.rs)

    print_util.remove_logger(logger)
示例#3
0
def main(args):

    # make logger
    dataset = args.dataset

    for i in range(args.repeats):
        seed = args.rs + i
        rs_dir = os.path.join(args.out_dir, dataset, args.tree_type,
                              args.tree_kernel, 'rs{}'.format(seed))
        os.makedirs(rs_dir, exist_ok=True)

        logger = print_util.get_logger(os.path.join(rs_dir, 'log.txt'))
        logger.info(args)
        logger.info('Seed {}'.format(seed))

        experiment(args, logger, rs_dir, seed=seed)
        print_util.remove_logger(logger)