cagpjax.models.cagp
Computation-aware Gaussian Process models.
ComputationAwareGP
Bases: AbstractComputationAwareGP
Computation-aware Gaussian Process model.
This model implements scalable GP inference by using batch linear solver policies to project the kernel and data to a lower-dimensional subspace, while accounting for the extra uncertainty imposed by observing only this subspace.
Attributes:
Name | Type | Description |
---|---|---|
posterior |
The original (exact) posterior. |
|
policy |
AbstractBatchLinearSolverPolicy
|
The batch linear solver policy. |
jitter |
ScalarFloat
|
Numerical jitter for stability. |
Notes
- Only single-output models are currently supported.
Source code in src/cagpjax/models/cagp.py
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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
is_conditioned
property
Whether the model has been conditioned on training data.
__init__(posterior, policy, jitter=1e-06)
Initialize the Computation-Aware GP model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
posterior
|
ConjugatePosterior
|
GPJax conjugate posterior. |
required |
policy
|
AbstractBatchLinearSolverPolicy
|
The batch linear solver policy that defines the subspace into which the data is projected. |
required |
jitter
|
ScalarFloat
|
A small positive constant added to the diagonal of a covariance matrix when necessary to ensure numerical stability. |
1e-06
|
Source code in src/cagpjax/models/cagp.py
condition(train_data)
Compute and store the projected quantities of the conditioned GP posterior.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
train_data
|
Dataset
|
The training data used to fit the GP. |
required |
Source code in src/cagpjax/models/cagp.py
predict(test_inputs=None)
Compute the predictive distribution of the GP at the test inputs.
condition
must be called before this method can be used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_inputs
|
Float[Array, 'N D'] | None
|
The test inputs at which to make predictions. If not provided, predictions are made at the training inputs. |
None
|
Returns:
Name | Type | Description |
---|---|---|
GaussianDistribution |
GaussianDistribution
|
The predictive distribution of the GP at the test inputs. |
Source code in src/cagpjax/models/cagp.py
prior_kl()
Compute KL divergence between CaGP posterior and GP prior..
Calculates \(\mathrm{KL}[q(f) || p(f)]\), where \(q(f)\) is the CaGP posterior approximation and \(p(f)\) is the GP prior.
condition
must be called before this method can be used.
Returns:
Type | Description |
---|---|
ScalarFloat
|
KL divergence value (scalar). |