def evaluate_params(fname): results = load_results(fname) results['obj'] = np.max(np.array(results['steps_balancing_pole_avg_list'])) results['argmax'] = np.argmax( np.array(results['steps_balancing_pole_avg_list'])) return results
steps = np.array(results['steps_balancing_pole_avg_list']) x = np.arange(steps.shape[0]) + 1 z = np.polyfit(x, steps, 6) poly_z = np.poly1d(z) err = (steps - poly_z(x)) error_std = np.sum(err**2) / 20000. print("error_std: " + str(error_std)) xp = np.linspace(1, 20000, 500) plt.plot(x, poly_z(x)) return 'polyfit mse: ' + str(error_std) if __name__ == '__main__': res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_GZHBARMBEOKH.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_BZEPXNSLQMIB.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_CPRWMGWHSGIZ.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/cartpole_sarsa_test_hyperopt1.1.h5py' print('loading: ' + res_filename) res = load_results(res_filename)
def evaluate_params(fname): results = load_results(fname) results['obj'] = np.max(np.array(results['steps_balancing_pole_avg_list'])) results['argmax'] = np.argmax(np.array(results['steps_balancing_pole_avg_list'])) return results
steps = np.array(results['steps_balancing_pole_avg_list']) x = np.arange(steps.shape[0])+1 z = np.polyfit(x,steps,6) poly_z = np.poly1d(z) err = (steps - poly_z(x)) error_std = np.sum(err**2)/20000. print("error_std: " + str(error_std)) xp = np.linspace(1,20000,500) plt.plot(x,poly_z(x)) return 'polyfit mse: ' + str(error_std) if __name__ == '__main__': res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_GZHBARMBEOKH.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_BZEPXNSLQMIB.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/clustertest/cartpole_hyperopt_nn_clustertest_CPRWMGWHSGIZ.h5py' print('loading: ' + res_filename) res = load_results(res_filename) plot_results(res) res_filename = '../results/cartpole_sarsa_test_hyperopt1.1.h5py' print('loading: ' + res_filename) res = load_results(res_filename)