質問編集履歴

1

自分が特にわからないと思っている具体的なコード部分を追加しました。

2019/10/14 13:34

投稿

e_stat
e_stat

スコア4

test CHANGED
File without changes
test CHANGED
@@ -19,6 +19,22 @@
19
19
  この部分は乱数を生成するためにグラム行列やらコレスキー分解やら出てきているのだと思うのですが、
20
20
 
21
21
  いまいち理解ができないというところです。
22
+
23
+
24
+
25
+
26
+
27
+ 特にわからないと思ったところは
28
+
29
+ x_base = np.arange(-1, 1, 0.01, dtype=float)
30
+
31
+ gram_matrix = np.exp(-gamma * ((x_base[:, np.newaxis] - x_base) ** 2))
32
+
33
+ gram_matrix = gram_matrix + np.identity(gram_matrix.shape[0]) * 1e-14**
34
+
35
+ L = np.linalg.cholesky(gram_matrix)
36
+
37
+ の部分です。
22
38
 
23
39
 
24
40
 
@@ -54,7 +70,7 @@
54
70
 
55
71
  gram_matrix = np.exp(-gamma * ((x_base[:, np.newaxis] - x_base) ** 2))
56
72
 
57
- gram_matrix = gram_matrix + np.identity(gram_matrix.shape[0]) * 1e-14
73
+ gram_matrix = gram_matrix + np.identity(gram_matrix.shape[0]) * 1e-14**
58
74
 
59
75
  L = np.linalg.cholesky(gram_matrix)
60
76