-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_mean_eval_OU_noise_sigma.m
165 lines (139 loc) · 9.16 KB
/
plot_mean_eval_OU_noise_sigma.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
clear;
number_of_evals = 5;
steps = 1;
rollout_ep_len_mean = 2;
rollout_ep_rew_mean = 3;
time_fps = 4;
train_beta_loss = 5;
train_fitness_score = 6;
train_mean_episodic_Re3_reward = 7;
train_mean_evaluation_length = 8;
train_mean_evaluation_reward = 9;
train_real_mean_ep_len = 10;
train_explained_variance = 11;
train_is_line_search_success = 12;
train_kl_divergence_loss = 13;
train_learning_rate = 14;
train_policy_objective = 15;
train_std = 16;
train_value_loss = 17;
path = "data_cpy/csv/OU_noise_sigma/";
OU_noise_sigma_005_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.05_number_0.csv"));
OU_noise_sigma_005_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.05_number_1.csv"));
OU_noise_sigma_005_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.05_number_2.csv"));
OU_noise_sigma_005_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.05_number_3.csv"));
OU_noise_sigma_005_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.05_number_4.csv"));
OU_noise_sigma_011_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.11_number_0.csv"));
OU_noise_sigma_011_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.11_number_1.csv"));
OU_noise_sigma_011_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.11_number_2.csv"));
OU_noise_sigma_011_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.11_number_3.csv"));
OU_noise_sigma_011_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.11_number_4.csv"));
OU_noise_sigma_016_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.16_number_0.csv"));
OU_noise_sigma_016_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.16_number_1.csv"));
OU_noise_sigma_016_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.16_number_2.csv"));
OU_noise_sigma_016_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.16_number_3.csv"));
OU_noise_sigma_016_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.16_number_4.csv"));
OU_noise_sigma_022_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.22_number_0.csv"));
OU_noise_sigma_022_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.22_number_1.csv"));
OU_noise_sigma_022_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.22_number_2.csv"));
OU_noise_sigma_022_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.22_number_3.csv"));
OU_noise_sigma_022_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.22_number_4.csv"));
OU_noise_sigma_027_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.27_number_0.csv"));
OU_noise_sigma_027_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.27_number_1.csv"));
OU_noise_sigma_027_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.27_number_2.csv"));
OU_noise_sigma_027_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.27_number_3.csv"));
OU_noise_sigma_027_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.27_number_4.csv"));
OU_noise_sigma_032_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.32_number_0.csv"));
OU_noise_sigma_032_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.32_number_1.csv"));
OU_noise_sigma_032_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.32_number_2.csv"));
OU_noise_sigma_032_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.32_number_3.csv"));
OU_noise_sigma_032_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.32_number_4.csv"));
OU_noise_sigma_038_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.38_number_0.csv"));
OU_noise_sigma_038_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.38_number_1.csv"));
OU_noise_sigma_038_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.38_number_2.csv"));
OU_noise_sigma_038_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.38_number_3.csv"));
OU_noise_sigma_038_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.38_number_4.csv"));
OU_noise_sigma_044_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.44_number_0.csv"));
OU_noise_sigma_044_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.44_number_1.csv"));
OU_noise_sigma_044_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.44_number_2.csv"));
OU_noise_sigma_044_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.44_number_3.csv"));
OU_noise_sigma_044_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.44_number_4.csv"));
OU_noise_sigma_049_number_0 = readmatrix(strcat(path, "OU_noise_sigma_0.49_number_0.csv"));
OU_noise_sigma_049_number_1 = readmatrix(strcat(path, "OU_noise_sigma_0.49_number_1.csv"));
OU_noise_sigma_049_number_2 = readmatrix(strcat(path, "OU_noise_sigma_0.49_number_2.csv"));
OU_noise_sigma_049_number_3 = readmatrix(strcat(path, "OU_noise_sigma_0.49_number_3.csv"));
OU_noise_sigma_049_number_4 = readmatrix(strcat(path, "OU_noise_sigma_0.49_number_4.csv"));
%delete the first row of all
OU_noise_sigma_005_number_0(1,:) = [];
OU_noise_sigma_005_number_1(1,:) = [];
OU_noise_sigma_005_number_2(1,:) = [];
OU_noise_sigma_005_number_3(1,:) = [];
OU_noise_sigma_005_number_4(1,:) = [];
OU_noise_sigma_011_number_0(1,:) = [];
OU_noise_sigma_011_number_1(1,:) = [];
OU_noise_sigma_011_number_2(1,:) = [];
OU_noise_sigma_011_number_3(1,:) = [];
OU_noise_sigma_011_number_4(1,:) = [];
OU_noise_sigma_016_number_0(1,:) = [];
OU_noise_sigma_016_number_1(1,:) = [];
OU_noise_sigma_016_number_2(1,:) = [];
OU_noise_sigma_016_number_3(1,:) = [];
OU_noise_sigma_016_number_4(1,:) = [];
OU_noise_sigma_022_number_0(1,:) = [];
OU_noise_sigma_022_number_1(1,:) = [];
OU_noise_sigma_022_number_2(1,:) = [];
OU_noise_sigma_022_number_3(1,:) = [];
OU_noise_sigma_022_number_4(1,:) = [];
OU_noise_sigma_027_number_0(1,:) = [];
OU_noise_sigma_027_number_1(1,:) = [];
OU_noise_sigma_027_number_2(1,:) = [];
OU_noise_sigma_027_number_3(1,:) = [];
OU_noise_sigma_027_number_4(1,:) = [];
OU_noise_sigma_032_number_0(1,:) = [];
OU_noise_sigma_032_number_1(1,:) = [];
OU_noise_sigma_032_number_2(1,:) = [];
OU_noise_sigma_032_number_3(1,:) = [];
OU_noise_sigma_032_number_4(1,:) = [];
OU_noise_sigma_038_number_0(1,:) = [];
OU_noise_sigma_038_number_1(1,:) = [];
OU_noise_sigma_038_number_2(1,:) = [];
OU_noise_sigma_038_number_3(1,:) = [];
OU_noise_sigma_038_number_4(1,:) = [];
OU_noise_sigma_044_number_0(1,:) = [];
OU_noise_sigma_044_number_1(1,:) = [];
OU_noise_sigma_044_number_2(1,:) = [];
OU_noise_sigma_044_number_3(1,:) = [];
OU_noise_sigma_044_number_4(1,:) = [];
OU_noise_sigma_049_number_0(1,:) = [];
OU_noise_sigma_049_number_1(1,:) = [];
OU_noise_sigma_049_number_2(1,:) = [];
OU_noise_sigma_049_number_3(1,:) = [];
OU_noise_sigma_049_number_4(1,:) = [];
% take the mean of all
OU_noise_sigma_005_avg = (OU_noise_sigma_005_number_0 + OU_noise_sigma_005_number_1 + OU_noise_sigma_005_number_2 + OU_noise_sigma_005_number_3 + OU_noise_sigma_005_number_4)/number_of_evals;
OU_noise_sigma_011_avg = (OU_noise_sigma_011_number_0 + OU_noise_sigma_011_number_1 + OU_noise_sigma_011_number_2 + OU_noise_sigma_011_number_3 + OU_noise_sigma_011_number_4)/number_of_evals;
OU_noise_sigma_016_avg = (OU_noise_sigma_016_number_0 + OU_noise_sigma_016_number_1 + OU_noise_sigma_016_number_2 + OU_noise_sigma_016_number_3 + OU_noise_sigma_016_number_4)/number_of_evals;
OU_noise_sigma_022_avg = (OU_noise_sigma_022_number_0 + OU_noise_sigma_022_number_1 + OU_noise_sigma_022_number_2 + OU_noise_sigma_022_number_3 + OU_noise_sigma_022_number_4)/number_of_evals;
OU_noise_sigma_027_avg = (OU_noise_sigma_027_number_0 + OU_noise_sigma_027_number_1 + OU_noise_sigma_027_number_2 + OU_noise_sigma_027_number_3 + OU_noise_sigma_027_number_4)/number_of_evals;
OU_noise_sigma_032_avg = (OU_noise_sigma_032_number_0 + OU_noise_sigma_032_number_1 + OU_noise_sigma_032_number_2 + OU_noise_sigma_032_number_3 + OU_noise_sigma_032_number_4)/number_of_evals;
OU_noise_sigma_038_avg = (OU_noise_sigma_038_number_0 + OU_noise_sigma_038_number_1 + OU_noise_sigma_038_number_2 + OU_noise_sigma_038_number_3 + OU_noise_sigma_038_number_4)/number_of_evals;
OU_noise_sigma_044_avg = (OU_noise_sigma_044_number_0 + OU_noise_sigma_044_number_1 + OU_noise_sigma_044_number_2 + OU_noise_sigma_044_number_3 + OU_noise_sigma_044_number_4)/number_of_evals;
OU_noise_sigma_049_avg = (OU_noise_sigma_049_number_0 + OU_noise_sigma_049_number_1 + OU_noise_sigma_049_number_2 + OU_noise_sigma_049_number_3 + OU_noise_sigma_049_number_4)/number_of_evals;
rows = size(OU_noise_sigma_005_avg, 1);
iterations_vec = [1:1:rows];
figure(1);
hold on;
plot(iterations_vec, OU_noise_sigma_005_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_011_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_016_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_022_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_027_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_032_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_038_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_044_avg(:,train_mean_evaluation_reward));
plot(iterations_vec, OU_noise_sigma_049_avg(:,train_mean_evaluation_reward));
legend('OU noise sigma 0.05', 'OU noise sigma 0.11', 'OU noise sigma 0.16', 'OU noise sigma 0.22', 'OU noise sigma 0.27', 'OU noise sigma 0.32', 'OU noise sigma 0.38', 'OU noise sigma 0.44', 'OU noise sigma 0.49');
title('train/mean\_evaluation\_reward over iterations for all OU noise sigma');
xlabel('iterations');
ylabel('train/mean\_evaluation\_reward');
hold off;