help="Optimized model type. It can be 'pupil' or optimizer or 'optimizer'. Default is 'optimizer'",
    default='optimizer',
)
parser.add_argument(
    "-v",
    "--verbose",
    help="Regulate verbosity",
    action='store_true'
)
args = parser.parse_args()

abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)

confs = parse_path_comb(args.confs)
eval_dirs = list()
for conf in confs:
    base = '.'.join(conf.split('.')[:-1])
    dirs = list()
    if args.model == 'optimizer':
        cand1 = os.path.join(base, 'evaluation')
        cand2 = os.path.join(base, 'eval_fix')
        if os.path.exists(cand1):
            dirs.append(cand1)
        if os.path.exists(cand2):
            dirs.append(cand2)
    elif args.model == 'pupil':
        base = os.path.join(base, 'evaluation')
        for eval_file in os.listdir(base):
            if 'launch_log' not in eval_file:
예제 #2
0
)
parser.add_argument("-nl",
                    "--no_line",
                    help="Do not link dots with line. Default is True",
                    action='store_true')
parser.add_argument(
    '-hpnf',
    "--hp_names_file",
    help=
    "File with hyper parameter names. All available files are in the same directory with this script",
    default='hp_plot_names_english.conf')
args = parser.parse_args()
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
dirs = parse_path_comb(args.dirs)

labels = args.labels.split(',')
datasets = args.datasets.split(',')

lines_by_metrics = dict()

label_idx = 0

if args.x_select is None:
    x_select = None
else:
    x_select = parse_x_select(args.x_select)
for label, dir in zip(labels, dirs):
    dir_contents = parse_1_line_dir(dir)
    for metric, metric_data in dir_contents.items():
예제 #3
0
parser.add_argument(
    '-on',
    '--old_name',
    help="old parameter names",
)
parser.add_argument(
    '-nn',
    '--new_name',
    help='new parameter names',
)
parser.add_argument(
    '-tp',
    '--types',
    help="Types of parameters. default is float for all",
    default=None,
)
args = parser.parse_args()

transformations = args.transformation.split(',')

old_names = args.old_name.split(',')

new_names = args.new_name.split(',')
num_params = len(old_names)

res_files = parse_path_comb(args.eval_file)

for f in res_files:
    perform_transformation(f, args.new_eval_dir, old_names, new_names,
                           args.types, transformations)
예제 #4
0
if args.x_select is None:
    select['x_select'] = None
else:
    select['x_select'] = parse_x_select(args.x_select)
if args.line_select is None:
    select['line_select'] = None
else:
    select['line_select'] = parse_line_select(args.line_select)

style = dict(
    no_line=args.no_line,
    error=args.error,
    marker=args.marker,
)

eval_dirs = parse_path_comb(args.eval_dir)
metric_scales = parse_metric_scales_str(args.metric_scales)

hp_plot_order = args.hp_order.split(',')
# abspath = os.path.abspath(__file__)
# dname = os.path.dirname(abspath)
# os.chdir(dname)
plot_parameter_names = get_parameter_names(
    os.path.join(*(os.path.split(os.path.abspath(__file__))[:-1] +
                   (args.hp_names_file, ))))
xscale = args.xscale

for eval_dir in eval_dirs:
    print(eval_dir)
    plot_dir = os.path.join(*list(os.path.split(eval_dir)[:-1]) +
                            [args.plot_dir])
예제 #5
0
                    "--verbose",
                    help="Regulate verbosity",
                    action='store_true')
parser.add_argument(
    '-ng',
    '--no_git',
    help="don't add confs to git",
    action='store_true',
)

args = parser.parse_args()

base_path = helmo.util.path_help.get_path_from_path_rel_to_repo_root(
    os.path.join('helmo', 'experiments'))

confs = parse_path_comb(args.confs, filter_=False)

hp_names_with_types = args.hyper_parameters.split(':')
hp_names = list()
types = list()
for s in hp_names_with_types:
    spl = s.split(',')
    hp_names.append(spl[0])
    types.append(spl[1])

span = args.span.split(':')

points = list()
for string in span:
    points.append(get_points_from_range(string))
예제 #6
0
parser.add_argument('-o',
                    "--output",
                    help="Output file name. Path relative to this script.")
parser.add_argument(
    '-i',
    "--inter_path",
    help="Path between model folder and results folder. default is 'test'",
    default='test',
)
parser.add_argument("-v",
                    "--verbose",
                    help="Regulate verbosity",
                    action='store_true')
args = parser.parse_args()

model_paths = parse_path_comb(args.model_paths, filter_=False)

results = dict()

for model_path in model_paths:
    results[model_path] = pupil_test_results_summarize(model_path,
                                                       args.inter_path)

string = stats_string_for_all_models(results, 2)

create_path(args.output, file_name_is_in_path=True)

with open(args.output, 'w') as f:
    f.write(string)

if args.verbose: