Beispiel #1
0
    parser.add_argument('-metric', '--metricList', nargs="+", default=None)
    parser.add_argument('-model', '--modelList', nargs="+", default=None)

    args = parser.parse_args()
    ms.set_gpu(args.gpu)

    visdom_util.CreatePlotter()

    # init random seed
    # init_random_seed(10)
    results = {}

    pp_main = pretty_plot.PrettyPlot(
        ratio=0.5,
        figsize=(5, 4),
        legend_type="line",
        yscale="linear",
        subplots=(1, 1),
        shareRowLabel=True)
    for exp_name in args.expList:
        exp_dict = experiments.get_experiment_dict(args, exp_name)
        exp_dict["reset_src"] = args.reset_src
        exp_dict["reset_tgt"] = args.reset_tgt

        # SET SEED
        np.random.seed(10)
        torch.manual_seed(10)
        torch.cuda.manual_seed_all(10)

        history = ms.load_history(exp_dict)
Beispiel #2
0
            if len(history["loss"]) == 0:
                continue
            results[history["exp_name"]] = history["loss"][-1]

        if args.mode == "plot_best":
            # if history["exp_name_no_lr"] in results:
            #     continue

            # results[history["exp_name_no_lr"]] = l
            ncols = len(dList)
            nrows = 1
            if create_plot == False:
                pp_main = pretty_plot.PrettyPlot(title="Experiment %s" %
                                                 history["exp_name"],
                                                 ratio=0.5,
                                                 legend_type="line",
                                                 yscale="log",
                                                 shareRowLabel=False,
                                                 figsize=(5 * ncols, 4 * 1),
                                                 subplots=(nrows, ncols))
                create_plot = True

            yx = pd.DataFrame(history["loss"])
            y_vals = np.abs(np.array(yx["loss"]))
            x_vals = yx["epoch"]

            if args.cut is not None:
                y_vals = y_vals[:args.cut]
                x_vals = x_vals[:args.cut]

            pp_main.add_yxList(y_vals=y_vals,
                               x_vals=x_vals,