第18章ガウス過程
18.3.7. Exercises18.3.7 練習問題
- We have emphasized the importance of learning kernel hyperparameters, and the effect of hyperparameters and kernels on the generalization properties of Gaussian processes. Try skipping the step where we learn hypers, and instead guess a variety of length-scales and noise variances, and check their effect on predictions. What happens when you use a large length-scale? A small length-scale? A large noise variance? A small noise variance?
英語のヒント
カーネルのハイパーパラメータを学習することの大切さと、ハイパーパラメータとカーネルがガウス過程の汎化の性質に与える影響を強調してきた。ハイパーパラメータを学習する段階を飛ばし、代わりにさまざまな長さスケールとノイズの分散を見積もって、それらが予測に与える影響を確かめてみよ。大きな長さスケールを使うと何が起こるか。小さな長さスケールでは。大きなノイズの分散では。小さなノイズの分散では。 - We have said that the marginal likelihood is not a convex objective, but that hyperparameters like length-scale and noise variance can be reliably estimated in GP regression. This is generally true — in fact, the marginal likelihood is much better at learning length-scale hyperparameters than conventional approaches in spatial statistics, which involve fitting empirical autocorrelation functions (“covariograms”). Arguably, the biggest contribution from machine learning to Gaussian process research, at least before recent work on scalable inference, was the introduction of the marginal lkelihood for hyperparameter learning.
英語のヒント
周辺尤度は凸な目的関数ではないが、GP回帰では長さスケールやノイズの分散のようなハイパーパラメータを確実に推定できると述べた。これはおおむね正しい。実際、周辺尤度は、経験的な自己相関関数(「コバリオグラム」)を当てはめる空間統計の従来のやり方よりも、長さスケールのハイパーパラメータをはるかにうまく学習する。少なくとも大規模推論についての最近の研究以前では、機械学習がガウス過程の研究にもたらした最大の貢献は、ハイパーパラメータの学習のための周辺尤度の導入だったと言ってよいだろう。
However, different pairings of even these parameters provide interpretably different plausible explanations for many datasets, leading to local optima in our objective. If we use a large length-scale, then we assume the true underlying function is slowly varying. If the observed data are varying significantly, then the only we can plausibly have a large length-scale is with a large noise-variance. If we use a small length-scale, on the other hand, our fit will be very sensitive to the variations in the data, leaving little room to explain variations with noise (aleatoric uncertainty).
英語のヒント
しかし、これらのパラメータでさえ、組み合わせが違えば、多くのデータセットに対して解釈上異なるもっともらしい説明を与え、目的関数に局所的な最適解をもたらす。大きな長さスケールを使うなら、背後にある真の関数がゆっくり変化すると仮定していることになる。観測したデータが大きく変化しているなら、大きな長さスケールをもっともらしくもてるのは、大きなノイズの分散をもつときだけである。一方、小さな長さスケールを使うと、当てはまりはデータの変化にとても敏感になり、変化をノイズ(偶然的不確かさ)で説明する余地がほとんど残らない。
Try seeing if you can find these local optima: initialize with very large length-scale with large noise, and small length-scales with small noise. Do you converge to different solutions?
英語のヒント
これらの局所的な最適解を見つけられるか試してみよ。とても大きな長さスケールと大きなノイズ、そして小さな長さスケールと小さなノイズで初期化せよ。異なる解に収束するか。
- We have said that a fundamental advantage of Bayesian methods is in naturally representing epistemic uncertainty. In the above example, we cannot fully see the effects of epistemic uncertainty. Try instead to predict with
test_x = np.linspace(0, 10, 1000). What happens to the 95% credible set as your predictions move beyond the data? Does it cover the true function in that interval? What happens if you only visualize aleatoric uncertainty in that region?英語のヒント
ベイズ的な方法の基本的な利点は、認識論的不確かさを自然に表せることにあると述べた。上の例では、認識論的不確かさの効果を十分に見ることはできない。代わりにtest_x = np.linspace(0, 10, 1000)で予測してみよ。予測がデータの範囲を越えると、95%信用集合はどうなるか。その区間で真の関数を覆っているか。その領域で偶然的不確かさだけを可視化すると何が起こるか。 - Try running the above example, but instead with 10,000, 20,000 and 40,000 training points, and measure the runtimes. How does the training time scale? Alternatively, how do the runtimes scale with the number of test points? Is it different for the predictive mean and the predictive variance? Answer this question both by theoretically working out the training and testing time complexities, and by running the code above with a different number of points.
英語のヒント
上の例を、代わりに10,000、20,000、40,000個の訓練点で実行して、実行時間を測ってみよ。訓練時間はどのように増えるか。あるいは、実行時間はテスト点の数とともにどのように増えるか。予測平均と予測分散で違うか。この問いに、訓練とテストの時間計算量を理論的に求めることと、上のコードを異なる数の点で実行することの両方で答えよ。 - Try running the GPyTorch example with different covariance functions, such as the Matern kernel. How do the results change? How about the spectral mixture kernel, found in the GPyTorch library? Are some easier to train the marginal likelihood than others? Are some more valuable for long-range versus short-range predictions?
英語のヒント
マターンカーネルのような異なる共分散関数で、GPyTorchの例を実行してみよ。結果はどう変わるか。GPyTorchライブラリにあるスペクトル混合カーネルではどうか。周辺尤度を訓練しやすいものとそうでないものがあるか。長距離の予測と短距離の予測で、より役立つものがあるか。 - In our GPyTorch example, we plotted the predictive distribution including observation noise, while in our “from scratch” example, we only included epistemic uncertainty. Re-do the GPyTorch example, but this time only plotting epistemic uncertainty, and compare to the from-scratch results. Do the predictive distributions now look the same? (They should.)
英語のヒント
GPyTorchの例では観測ノイズを含めた予測分布をプロットしたが、「一から」の例では認識論的不確かさだけを含めた。GPyTorchの例をやり直し、今度は認識論的不確かさだけをプロットして、一から書いた結果と比べよ。予測分布は同じに見えるか。(同じに見えるはずである。)