def __init__(self,<EOL>kernel,<EOL>index_points=None,<EOL>observation_index_points=None,<EOL>observations=None,<EOL>observation_noise_variance=<NUM_LIT:0.>,<EOL>predictive_noise_variance=None,<EOL>mean_fn=None,<EOL>jitter=<NUM_LIT>,<EOL>validate_args=False,<EOL>allow_nan_stats=False,<EOL>name='<STR_LIT>'):
parameters = dict(locals())<EOL>with tf.name_scope(name) as name:<EOL><INDENT>dtype = dtype_util.common_dtype([<EOL>index_points, observation_index_points, observations,<EOL>observation_noise_variance, predictive_noise_variance, jitter<EOL>], tf.float32)<EOL>if index_points is not None:<EOL><INDENT>index_points = tf.convert_to_tensor(<EOL>value=index_points, dtype=dtype, name='<STR_LIT>')<EOL><DEDENT>observation_index_points = (None if observation_index_points is None else<EOL>tf.convert_to_tensor(<EOL>value=observation_index_points,<EOL>dtype=dtype,<EOL>name='<STR_LIT>'))<EOL>observations = (None if observations is None else tf.convert_to_tensor(<EOL>value=observations, dtype=dtype, name='<STR_LIT>'))<EOL>observation_noise_variance = tf.convert_to_tensor(<EOL>value=observation_noise_variance,<EOL>dtype=dtype,<EOL>name='<STR_LIT>')<EOL>predictive_noise_variance = (<EOL>observation_noise_variance<EOL>if predictive_noise_variance is None else tf.convert_to_tensor(<EOL>value=predictive_noise_variance,<EOL>dtype=dtype,<EOL>name='<STR_LIT>'))<EOL>jitter = tf.convert_to_tensor(value=jitter, dtype=dtype, name='<STR_LIT>')<EOL>if (observation_index_points is None) != (observations is None):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>observations, observation_index_points))<EOL><DEDENT>if mean_fn is None:<EOL><INDENT>mean_fn = lambda x: tf.zeros([<NUM_LIT:1>], dtype=dtype)<EOL><DEDENT>else:<EOL><INDENT>if not callable(mean_fn):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>self._name = name<EOL>self._observation_index_points = observation_index_points<EOL>self._observations = observations<EOL>self._observation_noise_variance = observation_noise_variance<EOL>self._predictive_noise_variance = predictive_noise_variance<EOL>self._jitter = jitter<EOL>self._validate_args = validate_args<EOL>with tf.name_scope('<STR_LIT>'):<EOL><INDENT>conditional_kernel = tfpk.SchurComplement(<EOL>base_kernel=kernel,<EOL>fixed_inputs=observation_index_points,<EOL>diag_shift=jitter + observation_noise_variance)<EOL>if _is_empty_observation_data(<EOL>feature_ndims=kernel.feature_ndims,<EOL>observation_index_points=observation_index_points,<EOL>observations=observations):<EOL><INDENT>conditional_mean_fn = mean_fn<EOL><DEDENT>else:<EOL><INDENT>_validate_observation_data(<EOL>kernel=kernel,<EOL>observation_index_points=observation_index_points,<EOL>observations=observations)<EOL>def conditional_mean_fn(x):<EOL><INDENT>k_x_obs_linop = tf.linalg.LinearOperatorFullMatrix(<EOL>kernel.matrix(x, observation_index_points))<EOL>chol_linop = tf.linalg.LinearOperatorLowerTriangular(<EOL>conditional_kernel.divisor_matrix_cholesky)<EOL>diff = observations - mean_fn(observation_index_points)<EOL>return mean_fn(x) + k_x_obs_linop.matvec(<EOL>chol_linop.solvevec(chol_linop.solvevec(diff), adjoint=True))<EOL><DEDENT><DEDENT>graph_parents = [observation_noise_variance, jitter]<EOL>def _maybe_append(x):<EOL><INDENT>if x is not None:<EOL><INDENT>graph_parents.append(x)<EOL><DEDENT><DEDENT>_maybe_append(index_points)<EOL>_maybe_append(observation_index_points)<EOL>_maybe_append(observations)<EOL>super(GaussianProcessRegressionModel, self).__init__(<EOL>kernel=conditional_kernel,<EOL>mean_fn=conditional_mean_fn,<EOL>index_points=index_points,<EOL>jitter=jitter,<EOL>observation_noise_variance=predictive_noise_variance,<EOL>validate_args=validate_args,<EOL>allow_nan_stats=allow_nan_stats, name=name)<EOL>self._parameters = parameters<EOL>self._graph_parents = graph_parents<EOL><DEDENT><DEDENT>
Construct a GaussianProcessRegressionModel instance.

        Args:
          kernel: `PositiveSemidefiniteKernel`-like instance representing the
            GP's covariance function.
          index_points: `float` `Tensor` representing finite collection, or batch of
            collections, of points in the index set over which the GP is defined.
            Shape has the form `[b1, ..., bB, e, f1, ..., fF]` where `F` is the
            number of feature dimensions and must equal `kernel.feature_ndims` and
            `e` is the number (size) of index points in each batch. Ultimately this
            distribution corresponds to an `e`-dimensional multivariate normal. The
            batch shape must be broadcastable with `kernel.batch_shape` and any
            batch dims yielded by `mean_fn`.
          observation_index_points: `float` `Tensor` representing finite collection,
            or batch of collections, of points in the index set for which some data
            has been observed. Shape has the form `[b1, ..., bB, e, f1, ..., fF]`
            where `F` is the number of feature dimensions and must equal
            `kernel.feature_ndims`, and `e` is the number (size) of index points in
            each batch. `[b1, ..., bB, e]` must be broadcastable with the shape of
            `observations`, and `[b1, ..., bB]` must be broadcastable with the
            shapes of all other batched parameters (`kernel.batch_shape`,
            `index_points`, etc). The default value is `None`, which corresponds to
            the empty set of observations, and simply results in the prior
            predictive model (a GP with noise of variance
            `predictive_noise_variance`).
          observations: `float` `Tensor` representing collection, or batch of
            collections, of observations corresponding to
            `observation_index_points`. Shape has the form `[b1, ..., bB, e]`, which
            must be brodcastable with the batch and example shapes of
            `observation_index_points`. The batch shape `[b1, ..., bB]` must be
            broadcastable with the shapes of all other batched parameters
            (`kernel.batch_shape`, `index_points`, etc.). The default value is
            `None`, which corresponds to the empty set of observations, and simply
            results in the prior predictive model (a GP with noise of variance
            `predictive_noise_variance`).
          observation_noise_variance: `float` `Tensor` representing the variance
            of the noise in the Normal likelihood distribution of the model. May be
            batched, in which case the batch shape must be broadcastable with the
            shapes of all other batched parameters (`kernel.batch_shape`,
            `index_points`, etc.).
            Default value: `0.`
          predictive_noise_variance: `float` `Tensor` representing the variance in
            the posterior predictive model. If `None`, we simply re-use
            `observation_noise_variance` for the posterior predictive noise. If set
            explicitly, however, we use this value. This allows us, for example, to
            omit predictive noise variance (by setting this to zero) to obtain
            noiseless posterior predictions of function values, conditioned on noisy
            observations.
          mean_fn: Python `callable` that acts on `index_points` to produce a
            collection, or batch of collections, of mean values at `index_points`.
            Takes a `Tensor` of shape `[b1, ..., bB, f1, ..., fF]` and returns a
            `Tensor` whose shape is broadcastable with `[b1, ..., bB]`.
            Default value: `None` implies the constant zero function.
          jitter: `float` scalar `Tensor` added to the diagonal of the covariance
            matrix to ensure positive definiteness of the covariance matrix.
            Default value: `1e-6`.
          validate_args: Python `bool`, default `False`. When `True` distribution
            parameters are checked for validity despite possibly degrading runtime
            performance. When `False` invalid inputs may silently render incorrect
            outputs.
            Default value: `False`.
          allow_nan_stats: Python `bool`, default `True`. When `True`,
            statistics (e.g., mean, mode, variance) use the value `NaN` to
            indicate the result is undefined. When `False`, an exception is raised
            if one or more of the statistic's batch members are undefined.
            Default value: `False`.
          name: Python `str` name prefixed to Ops created by this class.
            Default value: 'GaussianProcessRegressionModel'.

        Raises:
          ValueError: if either
            - only one of `observations` and `observation_index_points` is given, or
            - `mean_fn` is not `None` and not callable.