Exemplo n.º 1
0
def main(_):
    this_dir = os.path.dirname(os.path.realpath(__file__))
    if FLAGS.seq_id == 'None':
        seq = [[FLAGS.config_id, FLAGS.num_trials]]
    else:
        seqs = json.load(open(os.path.join(this_dir, "seqs.json"), 'r'))
        seq = seqs[FLAGS.seq_id]
    summaries = []
    for config_id, num_trials in seq:
        if config_id == "None":
            config = get_config(FLAGS.__flags, {})
        else:
            # TODO : create config file (.json)
            configs_path = os.path.join(this_dir, "configs_new%s" % FLAGS.config_ext)
            config = get_config_from_file(FLAGS.__flags, configs_path, config_id)
        
        if config.task == "all":
            tasks = list(map(str, range(1, 6)))
        else:
            tasks = [config.task]
        for task in tasks:
            # FIXME : this is bad way of setting task each time
            config.task = task
            print("=" * 80)
            print("Config ID {}, task {}, {} trials".format(config.config_id, config.task, num_trials))
            summary = _main(config, num_trials)
            summaries.append(summary)
	
    print("=" * 80)
    print("SUMMARY")
    for summary in summaries:
        print(summary)
Exemplo n.º 2
0
Arquivo: main.py Projeto: yucoian/qrn
def main(_):
    this_dir = os.path.dirname(os.path.realpath(__file__))
    if FLAGS.seq_id == 'None':
        seq = [[FLAGS.config_id, FLAGS.num_trials]]
    else:
        seqs = json.load(open(os.path.join(this_dir, "seqs.json"), 'r'))
        seq = seqs[FLAGS.seq_id]
    summaries = []
    for config_id, num_trials in seq:
        if config_id == "None":
            config = get_config(FLAGS.__flags, {})
        else:
            # TODO : create config file (.json)
            configs_path = os.path.join(this_dir,
                                        "configs_new%s" % FLAGS.config_ext)
            config = get_config_from_file(FLAGS.__flags, configs_path,
                                          config_id)

        if config.task == "all":
            tasks = list(map(str, range(1, 6)))
        else:
            tasks = [config.task]
        for task in tasks:
            # FIXME : this is bad way of setting task each time
            config.task = task
            print("=" * 80)
            print("Config ID {}, task {}, {} trials".format(
                config.config_id, config.task, num_trials))
            summary = _main(config, num_trials)
            summaries.append(summary)

    print("=" * 80)
    print("SUMMARY")
    for summary in summaries:
        print(summary)
Exemplo n.º 3
0
def main(_):
    this_dir = os.path.dirname(os.path.realpath(__file__))
    if FLAGS.seq_id == 'None':
        seq = [[FLAGS.config_id, 1]]
    else:
        seqs = json.load(open(os.path.join(this_dir, "seqs.json"), 'r'))
        seq = seqs[FLAGS.seq_id]
    print(seq)
    summaries = []
    for config_id, num_trials in seq:
        if config_id == "None":
            config = get_config(FLAGS.__flags, {})
        else:
            # TODO : create config file (.json)
            configs_path = os.path.join(this_dir,
                                        "configs%s" % FLAGS.config_ext)
            config = get_config_from_file(FLAGS.__flags, configs_path,
                                          config_id)
        print("=" * 80)
        print("Config ID {}, task {}, {} trials".format(
            config.config_id, config.task, num_trials))
        summary = _main(config, num_trials)
        summaries.append(summary)

    print("=" * 80)
    print("SUMMARY")
    for summary in summaries:
        print(summary)
Exemplo n.º 4
0
Arquivo: main.py Projeto: eunchung/qrn
def main(_):
    this_dir = os.path.dirname(os.path.realpath(__file__))
    if FLAGS.seq_id == 'None':
        seq = [[FLAGS.config_id, 1]]
    else:
        seqs = json.load(open(os.path.join(this_dir, "seqs.json"), 'r'))
        seq = seqs[FLAGS.seq_id]
    print(seq)
    summaries = []
    for config_id, num_trials in seq:
        if config_id == "None":
            config = get_config(FLAGS.__flags, {})
        else:
            # TODO : create config file (.json)
            configs_path = os.path.join(this_dir, "configs%s" % FLAGS.config_ext)
            config = get_config_from_file(FLAGS.__flags, configs_path, config_id)
        print("=" * 80)
        print("Config ID {}, task {}, {} trials".format(config.config_id, config.task, num_trials))
        summary = _main(config, num_trials)
        summaries.append(summary)

    print("=" * 80)
    print("SUMMARY")
    for summary in summaries:
        print(summary)