Skip to content

Commit 5da79a2

Browse files
committed
Full transition of result printing
1 parent 38d5f70 commit 5da79a2

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

examples/3-priorGP/script.jl

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ cs
8080
# If we sample a lot more functions however, we get closer to the anaytical result
8181
n_manysamples = 1000
8282
y_sample = [naive_sample(gp, x_sample) for _ in 1:n_manysamples]
83-
evaluate_samples(y_sample, m, K)
83+
ms, cs = evaluate_samples(y_sample, m, K);
84+
#-
85+
ms
86+
#-
87+
cs
8488

8589
#
8690
# However, there are two issues with this approach:
@@ -120,25 +124,41 @@ DisplayAs.PNG(f) #hide #md
120124
# Unfortunately, the mean and the covariance are worse than with the naive sampling
121125
# for the same number of samples.
122126
y_sample = [ApproximateGPSample(rff).(x_sample) for _ in 1:n_samples]
123-
evaluate_samples(y_sample, m, K)
127+
ms, cs = evaluate_samples(y_sample, m, K);
128+
#-
129+
ms
130+
#-
131+
cs
124132

125133
# However, we now have another parameter to tune: The number of features
126134
# By increasing the number of features, we get close to the result we saw
127135
# with the naive sampling.
128136
rff500 = DoubleRFF(S, 500)
129137
y_sample = [ApproximateGPSample(rff500).(x_sample) for _ in 1:n_samples]
130-
evaluate_samples(y_sample, m, K)
138+
ms, cs = evaluate_samples(y_sample, m, K);
139+
#-
140+
ms
141+
#-
142+
cs
131143

132144
# By increasing the number of GP samples, we can again improve the results in
133145
# both cases.
134146
#
135147
# With 10 feature functions
136148
y_sample = [ApproximateGPSample(rff).(x_sample) for _ in 1:n_manysamples]
137-
evaluate_samples(y_sample, m, K)
149+
ms, cs = evaluate_samples(y_sample, m, K);
150+
#-
151+
ms
152+
#-
153+
cs
138154
#
139155
# With 500 feature functions
140156
y_sample = [ApproximateGPSample(rff500).(x_sample) for _ in 1:n_manysamples]
141-
evaluate_samples(y_sample, m, K)
157+
ms, cs = evaluate_samples(y_sample, m, K);
158+
#-
159+
ms
160+
#-
161+
cs
142162

143163
#
144164
# Lastly, we note that we no longer have to worry about conditioning issues,

0 commit comments

Comments
 (0)