第18章ガウス過程
18.2.2. A Simple Gaussian Process18.2.2 単純なガウス過程
Suppose , and , with all in one dimension. We can equivalently write this function as the inner product . In (18.2.1) above, and .
英語のヒント
、とし、はすべて1次元であるとしよう。この関数は、内積として同値に書ける。上の(18.2.1)では、、である。
For any , is a sum of two Gaussian random variables. Since Gaussians are closed under addition, is also a Gaussian random variable for any . In fact, we can compute for any particular that is . Similarly, the joint distribution for any collection of function values, , for any collection of inputs , is a multivariate Gaussian distribution. Therefore is a Gaussian process.
英語のヒント
任意のについて、は二つのガウス確率変数の和である。ガウス分布は足し算について閉じているので、任意のについてもガウス確率変数である。実際、任意の特定のについて、がに従うことを計算できる。同じように、入力の任意の集まりについての関数の値の任意の集まりの同時分布は、多変量ガウス分布である。したがって、はガウス過程である。
In short, is a random function, or a distribution over functions. We can gain some insights into this distribution by repeatedly sampling values for , and visualizing the corresponding functions , which are straight lines with slopes and different intercepts, as follows:
英語のヒント
要するに、はランダムな関数、つまり関数の上の分布である。の値を繰り返し抜き出し、対応する関数を次のように可視化すると、この分布についていくらか見通しが得られる。これらの関数は、傾きのある、切片の異なる直線である。
def lin_func(x, n_sample):
preds = np.zeros((n_sample, x.shape[0]))
for ii in range(n_sample):
w = np.random.normal(0, 1, 2)
y = w[0] + w[1] * x
preds[ii, :] = y
return preds
x_points = np.linspace(-5, 5, 50)
outs = lin_func(x_points, 10)
lw_bd = -2 * np.sqrt((1 + x_points ** 2))
up_bd = 2 * np.sqrt((1 + x_points ** 2))
d2l.plt.fill_between(x_points, lw_bd, up_bd, alpha=0.25)
d2l.plt.plot(x_points, np.zeros(len(x_points)), linewidth=4, color='black')
d2l.plt.plot(x_points, outs.T)
d2l.plt.xlabel("x", fontsize=20)
d2l.plt.ylabel("f(x)", fontsize=20)
d2l.plt.show()If and are instead drawn from , how do you imagine varying affects the distribution over functions?
英語のヒント
とが代わりにから抜き出されるとしたら、を変えると関数の上の分布にどう影響すると思うか。