예제 #1
0
            lines_by_metrics[metric] = dict()
        datasets_present = keys_from_list_in_dict(metric_data, datasets)
        if len(datasets_present) > 1:
            for dataset in datasets_present:
                lines_by_metrics[metric][label + '_' + dataset] = select_by_x(
                    extract_line_from_file(metric_data[dataset]), x_select)
        else:
            lines_by_metrics[metric][label] = select_by_x(
                extract_line_from_file(metric_data[datasets_present[0]]),
                x_select)
style = dict(
    no_line=args.no_line,
    error=args.error,
    marker=args.marker,
)
plot_parameter_names = get_parameter_names(args.hp_names_file)
xscale = args.xscale
metric_scales = parse_metric_scales_str(args.metric_scales)

create_path(args.plot_name, file_name_is_in_path=True)
for metric, lines_for_metric in lines_by_metrics.items():
    file_name = args.plot_name + '_' + metric
    ylabel = plot_parameter_names[metric]
    if metric in metric_scales:
        yscale = metric_scales[metric]
    else:
        yscale = 'linear'
    xlabel = args.xlabel
    description = nested2string(lines_for_metric)
    plot_outer_legend(
        lines_for_metric,
예제 #2
0
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])
    create_path(plot_dir)
    if args.model == 'optimizer':
        try:
            plot_hp_search_optimizer(
                eval_dir,
                plot_dir,
                hp_plot_order,
                plot_parameter_names,