Class: Matern
Matern kernel.
The class of Matern kernels is a generalization of the RBF
. It has an additional parameter \(\nu\) which controls the smoothness of the resulting function. The smaller \(\nu\), the less smooth the approximated function is. As \(\nu\rightarrow\infty\), the kernel becomes equivalent to the RBF
kernel. When \(\nu = 1/2\), the Matérn kernel becomes identical to the absolute exponential kernel. Important intermediate values are \(\nu=1.5\) (once differentiable functions) and \(\nu=2.5\) (twice differentiable functions).
The kernel is given by:
Constructors
new Matern()
new Matern(
opts
?):Matern
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.length_scale ? | number | ArrayLike | The length scale of the kernel. If a float, an isotropic kernel is used. If an array, an anisotropic kernel is used where each dimension of l defines the length-scale of the respective feature dimension. |
opts.length_scale_bounds ? | "fixed" | The lower and upper bound on ‘length_scale’. If set to “fixed”, ‘length_scale’ cannot be changed during hyperparameter tuning. |
opts.nu ? | number | The parameter nu controlling the smoothness of the learned function. The smaller nu, the less smooth the approximated function is. For nu=inf, the kernel becomes equivalent to the RBF kernel and for nu=0.5 to the absolute exponential kernel. Important intermediate values are nu=1.5 (once differentiable functions) and nu=2.5 (twice differentiable functions). Note that values of nu not in [0.5, 1.5, 2.5, inf] incur a considerably higher computational cost (appr. 10 times higher) since they require to evaluate the modified Bessel function. Furthermore, in contrast to l, nu is kept fixed to its initial value and not optimized. |
Returns Matern
Defined in generated/gaussian_process/kernels/Matern.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/gaussian_process/kernels/Matern.ts:23 |
_isInitialized | boolean | false | generated/gaussian_process/kernels/Matern.ts:22 |
_py | PythonBridge | undefined | generated/gaussian_process/kernels/Matern.ts:21 |
id | string | undefined | generated/gaussian_process/kernels/Matern.ts:18 |
opts | any | undefined | generated/gaussian_process/kernels/Matern.ts:19 |
Accessors
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/gaussian_process/kernels/Matern.ts:49
Methods
__call__()
__call__(
opts
):Promise
<ArrayLike
[]>
Return the kernel k(X, Y) and optionally its gradient.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.eval_gradient ? | boolean | Determines whether the gradient with respect to the log of the kernel hyperparameter is computed. Only supported when Y is undefined . |
opts.X ? | ArrayLike [] | Left argument of the returned kernel k(X, Y) |
opts.Y ? | ArrayLike [] | Right argument of the returned kernel k(X, Y). If undefined , k(X, X) if evaluated instead. |
Returns Promise
<ArrayLike
[]>
Defined in generated/gaussian_process/kernels/Matern.ts:117
clone_with_theta()
clone_with_theta(
opts
):Promise
<any
>
Returns a clone of self with given hyperparameters theta.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.theta ? | ArrayLike | The hyperparameters |
Returns Promise
<any
>
Defined in generated/gaussian_process/kernels/Matern.ts:161
diag()
diag(
opts
):Promise
<ArrayLike
>
Returns the diagonal of the kernel k(X, X).
The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Left argument of the returned kernel k(X, Y) |
Returns Promise
<ArrayLike
>
Defined in generated/gaussian_process/kernels/Matern.ts:195
dispose()
dispose():
Promise
<void
>
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Returns Promise
<void
>
Defined in generated/gaussian_process/kernels/Matern.ts:100
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>
Defined in generated/gaussian_process/kernels/Matern.ts:62
is_stationary()
is_stationary(
opts
):Promise
<any
>
Returns whether the kernel is stationary.
Parameters
Parameter | Type |
---|---|
opts | object |
Returns Promise
<any
>