r""" Compute the expected log density of the data, given a Gaussian distribution for the function values, i.e. if q(f) = N(Fmu, Fvar) and this object represents p(y|f) then this method computes ∫ log(p(y=Y|f)) q(f) df.
(
self, X: TensorType, Fmu: TensorType, Fvar: TensorType, Y: TensorType
)
| 234 | "return: [batch...]", |
| 235 | ) |
| 236 | def variational_expectations( |
| 237 | self, X: TensorType, Fmu: TensorType, Fvar: TensorType, Y: TensorType |
| 238 | ) -> tf.Tensor: |
| 239 | r""" |
| 240 | Compute the expected log density of the data, given a Gaussian |
| 241 | distribution for the function values, |
| 242 | |
| 243 | i.e. if |
| 244 | q(f) = N(Fmu, Fvar) |
| 245 | |
| 246 | and this object represents |
| 247 | |
| 248 | p(y|f) |
| 249 | |
| 250 | then this method computes |
| 251 | |
| 252 | ∫ log(p(y=Y|f)) q(f) df. |
| 253 | |
| 254 | This only works if the broadcasting dimension of the statistics of q(f) (mean and variance) |
| 255 | are broadcastable with that of the data Y. |
| 256 | |
| 257 | :param X: input tensor |
| 258 | :param Fmu: mean function evaluation tensor |
| 259 | :param Fvar: variance of function evaluation tensor |
| 260 | :param Y: observation tensor |
| 261 | :returns: expected log density of the data given q(F) |
| 262 | """ |
| 263 | return self._variational_expectations(X, Fmu, Fvar, Y) |
| 264 | |
| 265 | @abc.abstractmethod |
| 266 | @check_shapes( |