Ejemplo n.º 1
0
def generatePlot(ax, exp_paths, bounds):
    for exp_path in exp_paths:
        exp = ExperimentModel.load(exp_path)

        results = loadResults(exp, 'return_summary.npy')

        plotSensitivity(results, param, ax, label=exp.agent)
Ejemplo n.º 2
0
def generatePlotTTA(ax, exp_path, bounds):
    exp = loadExperiment(exp_path)
    results = loadResults(exp, errorfile)
    const, unconst = tee(results)

    color = colors[exp.agent]
    label = rename(exp.agent)

    if 'ReghTDC' in exp.agent:
        const = whereParameterEquals(const, 'ratio', 1)
        const = whereParameterEquals(const, 'reg_h', 1)

    elif 'TDRCC' in exp.agent:
        const = whereParameterEquals(const, 'ratio', 1)
        # const = whereParameterEquals(const, 'reg_h', 0.8)
        const = whereParameterGreaterEq(const, 'reg_h', 0.01)

    elif 'TDC' in exp.agent:
        const = whereParameterGreaterEq(const, 'ratio', 1)

    if show_unconst:
        b = plotSensitivity(unconst, param, ax, stderr=stderr, color=color, label=label + '_unc', bestBy=bestBy, dashed=True)
        bounds.append(b)

    b = plotSensitivity(const, param, ax, stderr=stderr, color=color, label=label, bestBy=bestBy)
    bounds.append(b)
Ejemplo n.º 3
0
def generatePlot(exp_paths):
    ax = plt.gca()

    bounds = []
    for exp_path in exp_paths:
        exp = loadExperiment(exp_path)
        results = loadResults(exp)

        if exp.agent == 'TDadagrad':
            continue

        use_ideal_h = exp._d['metaParameters'].get('use_ideal_h', False)
        dashed = use_ideal_h
        color = colors[exp.agent]

        label = exp.agent.replace('adagrad', '')
        if use_ideal_h:
            label += '-h*'

        bound = plotSensitivity(results, 'h_variance', ax, label=label, color=color, dashed=dashed, bestBy='end')
        bounds.append(bound)

    lower = min(map(lambda x: x[0], bounds))
    upper = max(map(lambda x: x[1], bounds))

    ax.set_ylim([lower, upper])

    ax.set_xscale("log", basex=2)
    # plt.show()
    save(exp, f'h_variance-sensitivity')
    plt.clf()
Ejemplo n.º 4
0
def generatePlotTTA(ax, exp_paths, bestBy, bounds):
    ax.set_xscale("log", basex=2)
    for exp_path in exp_paths:
        if 'amsgrad' in exp_path:
            continue

        exp = loadExperiment(exp_path)
        rmsve = loadResults(exp, 'errors_summary.npy')
        rmspbe = loadResults(exp, 'rmspbe_summary.npy')

        agent = exp.agent
        if 'SmoothTDC' in agent:
            average = exp._d['metaParameters']['averageType']
            agent += '_' + average

        color = colors[agent]
        label = agent

        b = plotSensitivity(rmsve,
                            'ratio',
                            ax,
                            overStream=rmspbe,
                            color=color,
                            label=label,
                            bestBy=bestBy)
        bounds.append(b)
Ejemplo n.º 5
0
def generatePlot(exp_paths):
    ax = plt.gca()

    bounds = []
    i = -1
    for exp_path in exp_paths:
        i += 1
        exp = loadExperiment(exp_path)
        results = loadResults(exp, 'errors_summary.npy')

        param_dict = splitOverParameter(results, 'ratio')

        for key in param_dict:
            bound = plotSensitivity(param_dict[key],
                                    'alpha',
                                    ax,
                                    color=colors[i],
                                    bestBy='end')
            bounds.append(bound)

    lower = min(map(lambda x: x[0], bounds))
    upper = max(map(lambda x: x[1], bounds))

    ax.set_ylim([lower, upper])

    ax.set_xscale("log", basex=2)
    # plt.show()
    save(exp, f'alpha_over_beta_rmsve', type='svg')
    plt.clf()
Ejemplo n.º 6
0
def generatePlot(exp_paths):
    ax = plt.gca()

    bounds = []
    for exp_path in exp_paths:
        exp = loadExperiment(exp_path)
        results = loadResults(exp)

        if exp.agent == 'TDadagrad':
            continue

        color = colors[exp.agent]

        label = exp.agent.replace('adagrad', '')

        bound = plotSensitivity(results, 'h_variance', ax, label=label, color=color, bestBy='end')
        bounds.append(bound)

    # lower = min(map(lambda x: x[0], bounds))
    # upper = max(map(lambda x: x[1], bounds))

    # ax.set_ylim([lower, upper])

    ax.set_xscale("log", basex=2)
    plt.show()
    # save(exp, f'alpha-sensitivity')
    plt.clf()
Ejemplo n.º 7
0
def generatePlot(ax, exp_path, bounds):
    exp = loadExperiment(exp_path)
    results = loadResults(exp, errorfile)

    color = colors[exp.agent]
    label = exp.agent

    b = plotSensitivity(results, param, ax, color=color, label=label, bestBy=bestBy)
    bounds.append(b)
Ejemplo n.º 8
0
def generatePlot(ax, exp_path, bounds):
    exp = loadExperiment(exp_path)
    results = loadResults(exp, errorfile)
    results = addUpdateParam(results)

    color = colors[exp.agent]
    label = rename(exp.agent)

    b = plotSensitivity(results,
                        "updates",
                        ax,
                        color=color,
                        label=label,
                        bestBy=bestBy)
    bounds.append(b)
Ejemplo n.º 9
0
def generatePlotTTA(ax, exp_paths, bestBy, bounds):
    ax.set_xscale("log", basex=2)
    for exp_path in exp_paths:
        exp = loadExperiment(exp_path)
        results = loadResults(exp, errorfile)

        agent = exp.agent
        color = colors[agent]
        label = agent

        b = plotSensitivity(results,
                            'reg_h',
                            ax,
                            reducer='best',
                            color=color,
                            label=label,
                            bestBy=bestBy)
        bounds.append(b)
Ejemplo n.º 10
0
def generatePlotTTA(ax, exp_paths, bestBy, bounds):
    ax.set_xscale("log", basex=2)
    for exp_path in exp_paths:
        exp = loadExperiment(exp_path)
        results = loadResults(exp, errorfile)

        agent = exp.agent
        if 'SmoothTDC' in agent:
            average = exp._d['metaParameters']['averageType']
            agent += '_' + average

        color = colors[agent]
        label = agent

        b = plotSensitivity(results,
                            'buffer',
                            ax,
                            color=color,
                            label=label,
                            bestBy=bestBy)
        bounds.append(b)
Ejemplo n.º 11
0
def generatePlotTTA(ax, exp_paths, bestBy, bounds):
    ax.set_xscale("log", basex=2)
    for exp_path in exp_paths:
        exp = loadExperiment(exp_path)
        results = loadResults(exp, errorfile)

        agent = exp.agent
        color = colors[agent]
        label = agent

        if exp.agent == 'ReghTDC':
            results = whereParameterGreaterEq(results, 'ratio', 1.0)

        # reducer='best' chooses the best value of other parameters *per value of 'replay'*
        # reducer='slice' first chooses the best parameter setting, then sweeps over 'replay' with other parameters fixed
        b = plotSensitivity(results,
                            'replay',
                            ax,
                            reducer='best',
                            color=color,
                            label=label,
                            bestBy=bestBy)
        bounds.append(b)