Unconstrained
gpplus.kernels.unconstrained_kernel.UnconstrainedKernel
¤
Bases: Kernel
Source code in gpplus/kernels/unconstrained_kernel.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
has_lengthscale = False
class-attribute
instance-attribute
¤
ard_num_dims = ard_num_dims
instance-attribute
¤
eps = eps
instance-attribute
¤
distance_module = None
instance-attribute
¤
__pdist_supports_batch = True
instance-attribute
¤
__init__(ard_num_dims: Optional[int] = None, batch_shape: Optional[torch.Size] = None, active_dims: Optional[Tuple[int, ...]] = None, lengthscale_prior: Optional[Prior] = None, lengthscale_constraint: Optional[SoftClamp] = None, eps: float = 1e-06, **kwargs)
¤
Source code in gpplus/kernels/unconstrained_kernel.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
covar_dist(x1: Tensor, x2: Tensor, diag: bool = False, last_dim_is_batch: bool = False, ord: float = 2, **params) -> Tensor
¤
This is a helper method for computing the Euclidean distance between
all pairs of points in :math:\mathbf x_1 and :math:\mathbf x_2.
:param x1: First set of data (... x N x D).
:param x2: Second set of data (... x M x D).
:param diag: Should the Kernel compute the whole kernel, or just the diag?
If True, it must be the case that x1 == x2. (Default: False.)
:param last_dim_is_batch: If True, treat the last dimension
of x1 and x2 as another batch dimension.
(Useful for additive structure over the dimensions). (Default: False.)
:param square_dist:
If True, returns the squared distance rather than the standard distance. (Default: False.)
:return: The kernel matrix or vector. The shape depends on the kernel's evaluation mode:
* `full_covar`: `... x N x M`
* `full_covar` with `last_dim_is_batch=True`: `... x K x N x M`
* `diag`: `... x N`
* `diag` with `last_dim_is_batch=True`: `... x K x N`
Source code in gpplus/kernels/unconstrained_kernel.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
gpplus.kernels.power_exponential_kernel.PowerExponentialKernel
¤
Bases: UnconstrainedKernel
Source code in gpplus/kernels/power_exponential_kernel.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
has_lengthscale = True
class-attribute
instance-attribute
¤
is_stationary = True
class-attribute
instance-attribute
¤
power
property
writable
¤
ard_num_dims = ard_num_dims
instance-attribute
¤
eps = eps
instance-attribute
¤
distance_module = None
instance-attribute
¤
__pdist_supports_batch = True
instance-attribute
¤
__init__(**kwargs)
¤
Source code in gpplus/kernels/power_exponential_kernel.py
37 38 39 40 41 42 43 44 45 46 47 | |
forward(x1, x2, diag=False, **params)
¤
Source code in gpplus/kernels/power_exponential_kernel.py
64 65 66 67 68 69 70 | |
covar_dist(x1: Tensor, x2: Tensor, diag: bool = False, last_dim_is_batch: bool = False, ord: float = 2, **params) -> Tensor
¤
This is a helper method for computing the Euclidean distance between
all pairs of points in :math:\mathbf x_1 and :math:\mathbf x_2.
:param x1: First set of data (... x N x D).
:param x2: Second set of data (... x M x D).
:param diag: Should the Kernel compute the whole kernel, or just the diag?
If True, it must be the case that x1 == x2. (Default: False.)
:param last_dim_is_batch: If True, treat the last dimension
of x1 and x2 as another batch dimension.
(Useful for additive structure over the dimensions). (Default: False.)
:param square_dist:
If True, returns the squared distance rather than the standard distance. (Default: False.)
:return: The kernel matrix or vector. The shape depends on the kernel's evaluation mode:
* `full_covar`: `... x N x M`
* `full_covar` with `last_dim_is_batch=True`: `... x K x N x M`
* `diag`: `... x N`
* `diag` with `last_dim_is_batch=True`: `... x K x N`
Source code in gpplus/kernels/unconstrained_kernel.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
gpplus.kernels.power_exponential_kernel.PowerExponentialKernelFixed
¤
Bases: UnconstrainedKernel
Source code in gpplus/kernels/power_exponential_kernel.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
has_lengthscale = True
class-attribute
instance-attribute
¤
is_stationary = True
class-attribute
instance-attribute
¤
power = power
instance-attribute
¤
ard_num_dims = ard_num_dims
instance-attribute
¤
eps = eps
instance-attribute
¤
distance_module = None
instance-attribute
¤
__pdist_supports_batch = True
instance-attribute
¤
__init__(power=2.0, **kwargs)
¤
Source code in gpplus/kernels/power_exponential_kernel.py
16 17 18 19 20 21 22 | |
forward(x1, x2, diag=False, **params)
¤
Source code in gpplus/kernels/power_exponential_kernel.py
24 25 26 27 28 29 30 | |
covar_dist(x1: Tensor, x2: Tensor, diag: bool = False, last_dim_is_batch: bool = False, ord: float = 2, **params) -> Tensor
¤
This is a helper method for computing the Euclidean distance between
all pairs of points in :math:\mathbf x_1 and :math:\mathbf x_2.
:param x1: First set of data (... x N x D).
:param x2: Second set of data (... x M x D).
:param diag: Should the Kernel compute the whole kernel, or just the diag?
If True, it must be the case that x1 == x2. (Default: False.)
:param last_dim_is_batch: If True, treat the last dimension
of x1 and x2 as another batch dimension.
(Useful for additive structure over the dimensions). (Default: False.)
:param square_dist:
If True, returns the squared distance rather than the standard distance. (Default: False.)
:return: The kernel matrix or vector. The shape depends on the kernel's evaluation mode:
* `full_covar`: `... x N x M`
* `full_covar` with `last_dim_is_batch=True`: `... x K x N x M`
* `diag`: `... x N`
* `diag` with `last_dim_is_batch=True`: `... x K x N`
Source code in gpplus/kernels/unconstrained_kernel.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
gpplus.kernels.gaussian_kernel.GaussianKernel
¤
Bases: UnconstrainedKernel
Source code in gpplus/kernels/gaussian_kernel.py
11 12 13 14 15 16 17 18 19 20 21 22 23 | |
has_lengthscale = True
class-attribute
instance-attribute
¤
is_stationary = True
class-attribute
instance-attribute
¤
ard_num_dims = ard_num_dims
instance-attribute
¤
eps = eps
instance-attribute
¤
distance_module = None
instance-attribute
¤
__pdist_supports_batch = True
instance-attribute
¤
forward(x1, x2, diag=False, **params)
¤
Source code in gpplus/kernels/gaussian_kernel.py
15 16 17 18 19 20 21 22 23 | |
__init__(ard_num_dims: Optional[int] = None, batch_shape: Optional[torch.Size] = None, active_dims: Optional[Tuple[int, ...]] = None, lengthscale_prior: Optional[Prior] = None, lengthscale_constraint: Optional[SoftClamp] = None, eps: float = 1e-06, **kwargs)
¤
Source code in gpplus/kernels/unconstrained_kernel.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
covar_dist(x1: Tensor, x2: Tensor, diag: bool = False, last_dim_is_batch: bool = False, ord: float = 2, **params) -> Tensor
¤
This is a helper method for computing the Euclidean distance between
all pairs of points in :math:\mathbf x_1 and :math:\mathbf x_2.
:param x1: First set of data (... x N x D).
:param x2: Second set of data (... x M x D).
:param diag: Should the Kernel compute the whole kernel, or just the diag?
If True, it must be the case that x1 == x2. (Default: False.)
:param last_dim_is_batch: If True, treat the last dimension
of x1 and x2 as another batch dimension.
(Useful for additive structure over the dimensions). (Default: False.)
:param square_dist:
If True, returns the squared distance rather than the standard distance. (Default: False.)
:return: The kernel matrix or vector. The shape depends on the kernel's evaluation mode:
* `full_covar`: `... x N x M`
* `full_covar` with `last_dim_is_batch=True`: `... x K x N x M`
* `diag`: `... x N`
* `diag` with `last_dim_is_batch=True`: `... x K x N`
Source code in gpplus/kernels/unconstrained_kernel.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |