Exemple #1
0
                    min_avgs[env_key] = data['avg'][index]
                    min_stds[env_key] = data['std'][index]

    for env_key in env_keys:
        ps[env_key] = sorted(ps[env_key])
        avgs[env_key] = np.array([avgs[env_key][p] for p in ps[env_key]])
        stds[env_key] = np.array([stds[env_key][p] for p in ps[env_key]])

    os.chdir(cwd)

    return env_keys, ps, avgs, stds, min_avgs, min_stds



if __name__ == '__main__':
    env_keys, ps, avgs, stds, min_avgs, min_stds = load_data('nn')

    colors = [graphs.BLUE, graphs.PINK, graphs.GREEN]
    graphs.output_file('fixed_graph.html')

    env_displayed = [env_key for env_key in env_keys if env_key[0] == 'kin20_150' and env_key[2] == 5000]

    for color, envd in zip(colors, env_displayed):
        print(avgs[envd])
        y_max = max(avgs[envd] + stds[envd])
        graphs.perf_std_discrete(ps[envd], avgs[envd], stds[envd], std_width=0.0035, color=color,
                                 y_range=[0.0, y_max+0.02], plot_width=1000, plot_height=500, title='{} {}'.format(*envd))
        graphs.hold(True)

    graphs.show()
Exemple #2
0
    for N in Ns:
        index = data['ticks'].index(N)
        adapt_avgs[(d, N)] = data['avg'][index]
        adapt_stds[(d, N)] = data['std'][index]

os.chdir(cwd)


for d in disturbs:
    for N in Ns:
        print('N={}:  {} +- {}'.format(N, adapt_avgs[(d, N)], adapt_stds[(d, N)]))



if __name__ == '__main__':
    graphs.output_file('ddmab_graph.html')
    y_ranges=[(0.075, 0.3), (0.0, 0.1), (0.08, 0.14)]

    for i, d in enumerate(disturbs):
        y_range = y_ranges[i]
        for N in Ns:
            graphs.perf_std_discrete([100*i*0.05 for i in range(21)],
                                     avgs[('kin20_150', d, N)], stds[('kin20_150', d, N)],
                                     std_width=0.25, alpha=0.5, y_range=y_range,
                                     plot_height=300, title='d={} t={}'.format(d, N))
            graphs.hold(True)
            graphs.line([0, 100], adapt_avgs[(d, N)], adapt_stds[(d, N)])
            graphs.hold(False)

    graphs.show()