6
6
7
7
These are the basic kernels without any transformation of the data. They are the building blocks of KernelFunctions
8
8
9
+
10
+ ## Constant Kernels
11
+
12
+ ### Constant Kernel
13
+
14
+ The [ ` ConstantKernel ` ] ( @ref ) is defined as
15
+
16
+ ``` math
17
+ k(x,x';c) = c,
18
+ ```
19
+
20
+ where $c \in \mathbb{R}$.
21
+
22
+ ### White Kernel
23
+
24
+ The [ ` WhiteKernel ` ] ( @ref ) is defined as
25
+
26
+ ``` math
27
+ k(x,x') = \delta(x-x').
28
+ ```
29
+
30
+ ### Zero Kernel
31
+
32
+ The [ ` ZeroKernel ` ] ( @ref ) is defined as
33
+
34
+ ``` math
35
+ k(x,x') = 0.
36
+ ```
37
+
38
+ ## Cosine Kernel
39
+
40
+ The [ ` CosineKernel ` ] ( @ref ) is defined as
41
+
42
+ ``` math
43
+ k(x, x') = \cos(\pi |x-x'|),
44
+ ```
45
+
46
+ where $x\in\mathbb{R}$.
47
+
9
48
## Exponential Kernels
10
49
11
50
### Exponential Kernel
@@ -25,11 +64,40 @@ The [`SqExponentialKernel`](@ref) is defined as
25
64
### Gamma Exponential Kernel
26
65
27
66
The [ ` GammaExponentialKernel ` ] ( @ref ) is defined as
67
+
28
68
``` math
29
69
k(x,x';\gamma) = \exp\left(-\|x-x'\|^{2\gamma}\right),
30
70
```
31
71
where $\gamma > 0$.
32
72
73
+ ## Exponentiated Kernel
74
+
75
+ The [ ` ExponentiatedKernel ` ] ( @ref ) is defined as
76
+
77
+ ``` math
78
+ k(x,x') = \exp\left(\langle x,x'\rangle).
79
+ ```
80
+
81
+ ## Fractional Brownian Motion
82
+
83
+ The [ ` FBMKernel ` ] ( @ref ) is defined as
84
+
85
+ ``` math
86
+ k(x,x';h) = \frac{|x|^{2h} + |x'|^{2h} - |x-x'|^{2h}}{2},
87
+ ```
88
+
89
+ where $h$ is the [ Hurst index] ( https://en.wikipedia.org/wiki/Hurst_exponent#Generalized_exponent ) and $0<h<1$.
90
+
91
+ ## Gabor Kernel
92
+
93
+ The [ ` GaborKernel ` ] ( @ref ) is defined as
94
+
95
+ ``` math
96
+ k(x,x'; l,p) =& h(x-x';l,p)\\
97
+ h(u;l,p) =& \exp\left(-\cos\left(\pi \sum_i \frac{u_i}{p_i}\right)\sum_i \frac{u_i^2}{l_i^2}\right),
98
+ ```
99
+ where $l_i >0 $ is the lengthscale and $p_i>0$ is the period.
100
+
33
101
## Matern Kernels
34
102
35
103
### Matern Kernel
@@ -58,27 +126,35 @@ The [`Matern52Kernel`](@ref) is defined as
58
126
k(x,x') = \left(1+\sqrt{5}|x-x'|+\frac{5}{2}\|x-x'\|^2\right)\exp\left(\sqrt{5}|x-x'|\right).
59
127
```
60
128
61
- ## Rational Quadratic
129
+ ## Neural Network Kernel
62
130
63
- ### Rational Quadratic Kernel
131
+ The [ ` NeuralNetworkKernel ` ] ( @ref ) (as in the kernel for an infinitely wide neural network interpretated as a Gaussian process) is defined as
64
132
65
- The [ ` RationalQuadraticKernel ` ] ( @ref ) is defined as
133
+ ``` math
134
+ k(x, x') = \arcsin\left(\frac{\langle x, x'\rangle}{\sqrt{(1+\langle x, x\rangle)(1+\langle x',x'\rangle)}}\right).
135
+ ```
136
+
137
+ ## Periodic Kernel
138
+
139
+ The [ ` PeriodicKernel ` ] ( @ref ) is defined as
66
140
67
141
``` math
68
- k(x,x';\alpha ) = \left(1+\frac{\|x-x'\|^2}{\alpha}\ right)^{-\alpha} ,
142
+ k(x,x';r ) = \exp\ left(-0.5 \sum_i (sin (π(x_i - x'_i))/r_i)^2\ right),
69
143
```
70
144
71
- where $\alpha > 0$.
145
+ where $r$ has the same dimension as $x$ and $r_i > 0$.
72
146
73
- ### Gamma Rational Quadratic Kernel
147
+ ## Piecewise Polynomial Kernel
74
148
75
- The [ ` GammaRationalQuadraticKernel ` ] ( @ref ) is defined as
149
+ The [ ` PiecewisePolynomialKernel ` ] ( @ref ) is defined as
76
150
77
151
``` math
78
- k(x,x';\alpha,\gamma) = \left(1+\frac{\|x-x'\|^{2\gamma}}{\alpha}\right)^{-\alpha},
152
+ k(x,x'; P, V) =& \max(1 - r, 0)^{j + V} f(r, j),\\
153
+ r =& x^\top P x',\\
154
+ j =& \lfloor \frac{D}{2}\rfloor + V + 1,
79
155
```
80
-
81
- where $\alpha > 0$ and $\gamma > 0$ .
156
+ where $x\in \mathbb{R}^D$, $V \in \{ 0,1,2,3 \} and $P$ is a positive definite matrix.
157
+ $f$ is a piecewise polynomial (see source code) .
82
158
83
159
## Polynomial Kernels
84
160
@@ -102,45 +178,46 @@ The [`PolynomialKernel`](@ref) is defined as
102
178
103
179
where $c \in \mathbb{R}$ and $d>0$
104
180
105
- ## Periodic Kernels
106
181
107
- ### Periodic Kernel
182
+ ## Rational Quadratic
108
183
109
- The [ ` PeriodicKernel ` ] ( @ref ) is defined as
184
+ ### Rational Quadratic Kernel
185
+
186
+ The [ ` RationalQuadraticKernel ` ] ( @ref ) is defined as
110
187
111
188
``` math
112
- k(x,x';r ) = \exp\ left(-0.5 \sum_i (sin (π(x_i - x'_i))/r_i)^2\ right),
189
+ k(x,x';\alpha ) = \left(1+\frac{\|x-x'\|^2}{\alpha}\ right)^{-\alpha} ,
113
190
```
114
191
115
- where $r$ has the same dimension as $x$ and $r_i >0$.
116
-
117
- ## Constant Kernels
192
+ where $\alpha > 0$.
118
193
119
- ### Constant Kernel
194
+ ### Gamma Rational Quadratic Kernel
120
195
121
- The [ ` ConstantKernel ` ] ( @ref ) is defined as
196
+ The [ ` GammaRationalQuadraticKernel ` ] ( @ref ) is defined as
122
197
123
198
``` math
124
- k(x,x';c ) = c ,
199
+ k(x,x';\alpha,\gamma ) = \left(1+\frac{\|x-x'\|^{2\gamma}}{\alpha}\right)^{-\alpha} ,
125
200
```
126
201
127
- where $c \in \mathbb{R} $.
202
+ where $\alpha > 0$ and $\gamma > 0 $.
128
203
129
- ### White Kernel
204
+ ## Spectral Mixture Kernel
130
205
131
- The [ ` WhiteKernel ` ] ( @ref ) is defined as
206
+ The spectral mixture kernel is called by [ ` spectral_mixture_kernel ` ] ( @ref ) .
132
207
133
- ``` math
134
- k(x,x') = \delta(x-x').
135
- ```
136
208
137
- ### Zero Kernel
209
+ ## Wiener Kernel
138
210
139
- The [ ` ZeroKernel ` ] ( @ref ) is defined as
211
+ The [ ` WienerKernel ` ] ( @ref ) is defined as
140
212
141
213
``` math
142
- k(x,x') = 0.
214
+ k(x,x';i) = \left\{\begin{array}{cc}
215
+ \delta(x, x') & i = -1\\
216
+ \min(x,x') & i = 0\\
217
+ \frac{\min(x,x')^{2i+1}}{a_i} + b_i \min(x,x')^{i+1}|x-x'|r_i(x,x') & i\geq 1
218
+ \end{array}\right.,
143
219
```
220
+ where $i\in\{ -1,0,1,2,3\} $ and coefficients $a_i$, $b_i$ are fixed and residuals $r_i$ are defined in the code.
144
221
145
222
# Composite Kernels
146
223
0 commit comments