class_docstr: Marginal distribution of a Multitask GP at finitely many points.
docstr: Constructs a MultiTaskGaussianProcess instance.
  
  Args:
    kernel: `MultiTaskKernel`-like instance representing the
      GP's covariance function.
    index_points: (Nested) `float` `Tensor` representing finite collection, or
      batch of collections, of points in the index set over which the GP is
      defined. Shape (of shape of each nested component) has the form
      `[b1, ..., bB, e, f1, ..., fF]` where `F` is the number of feature
      dimensions and must equal `kernel.feature_ndims` (or its corresponding
      nested component) 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`.
    mean_fn: Python `callable` that acts on `index_points` to produce a
      (batch of) collection of mean values at `index_points`. Takes a (nested)
      `Tensor` of shape `[b1, ..., bB, e, f1, ..., fF]` and returns a `Tensor`
      whose shape is broadcastable with `[b1, ..., bB, e, t]`, where `t` is
      the number of tasks.
    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.`
    cholesky_fn: Callable which takes a single (batch) matrix argument and
      returns a Cholesky-like lower triangular factor.  Default value: `None`,
      in which case `make_cholesky_with_jitter_fn(1e-6)` is used.
    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: 'MultiTaskGaussianProcess'.
docstr_tok: ["Constructs","a","MultiTaskGaussianProcess","instance",".","Args",":","kernel",":","`","MultiTaskKernel","`","-like","instance","representing","the","GP","'s","covariance","function",".","index_points",":","(","Nested",")","`","float","`","`","Tensor","`","representing","finite","collection",",","or","batch","of","collections",",","of","points","in","the","index","set","over","which","the","GP","is","defined",".","Shape","(","of","shape","of","each","nested","component",")","has","the","form","`","[","b1",",","...",",","bB",",","e",",","f1",",","...",",","fF","]","`","where","`","F","`","is","the","number","of","feature","dimensions","and","must","equal","`","kernel.feature_ndims","`","(","or","its","corresponding","nested","component",")","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","`",".","mean_fn",":","Python","`","callable","`","that","acts","on","`","index_points","`","to","produce","a","(","batch","of",")","collection","of","mean","values","at","`","index_points","`",".","Takes","a","(","nested",")","`","Tensor","`","of","shape","`","[","b1",",","...",",","bB",",","e",",","f1",",","...",",","fF","]","`","and","returns","a","`","Tensor","`","whose","shape","is","broadcastable","with","`","[","b1",",","...",",","bB",",","e",",","t","]","`",",","where","`","t","`","is","the","number","of","tasks",".","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.","`","cholesky_fn",":","Callable","which","takes","a","single","(","batch",")","matrix","argument","and","returns","a","Cholesky-like","lower","triangular","factor",".","Default","value",":","`","None","`",",","in","which","case","`","make_cholesky_with_jitter_fn","(","1e-6",")","`","is","used",".","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",":","'MultiTaskGaussianProcess","'","."]
code: def __init__(
      self,
      kernel,
      index_points=None,
      mean_fn=None,
      observation_noise_variance=None,
      cholesky_fn=None,
      validate_args=False,
      allow_nan_stats=False,
      name="MultiTaskGaussianProcess",
  ):
      """Constructs a MultiTaskGaussianProcess instance.
  
      Args:
        kernel: `MultiTaskKernel`-like instance representing the
          GP's covariance function.
        index_points: (Nested) `float` `Tensor` representing finite collection, or
          batch of collections, of points in the index set over which the GP is
          defined. Shape (of shape of each nested component) has the form
          `[b1, ..., bB, e, f1, ..., fF]` where `F` is the number of feature
          dimensions and must equal `kernel.feature_ndims` (or its corresponding
          nested component) 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`.
        mean_fn: Python `callable` that acts on `index_points` to produce a
          (batch of) collection of mean values at `index_points`. Takes a (nested)
          `Tensor` of shape `[b1, ..., bB, e, f1, ..., fF]` and returns a `Tensor`
          whose shape is broadcastable with `[b1, ..., bB, e, t]`, where `t` is
          the number of tasks.
        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.`
        cholesky_fn: Callable which takes a single (batch) matrix argument and
          returns a Cholesky-like lower triangular factor.  Default value: `None`,
          in which case `make_cholesky_with_jitter_fn(1e-6)` is used.
        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: 'MultiTaskGaussianProcess'.
      """
      parameters = dict(locals())
      with tf.name_scope(name) as name:
          input_dtype = dtype_util.common_dtype(
              dict(kernel=kernel, index_points=index_points),
              dtype_hint=nest_util.broadcast_structure(
                  kernel.feature_ndims, tf.float32
              ),
          )
  
          # If the input dtype is non-nested float, we infer a single dtype for the
          # input and the float parameters, which is also the dtype of the MTGP's
          # samples, log_prob, etc. If the input dtype is nested (or not float), we
          # do not use it to infer the MTGP's float dtype.
          if not tf.nest.is_nested(
              input_dtype
          ) and dtype_util.is_floating(input_dtype):
              dtype = dtype_util.common_dtype(
                  dict(
                      kernel=kernel,
                      index_points=index_points,
                      observation_noise_variance=observation_noise_variance,
                  ),
                  dtype_hint=tf.float32,
              )
              input_dtype = dtype
          else:
              dtype = dtype_util.common_dtype(
                  dict(
                      observation_noise_variance=observation_noise_variance
                  ),
                  dtype_hint=tf.float32,
              )
  
          if index_points is not None:
              index_points = nest_util.convert_to_nested_tensor(
                  index_points,
                  dtype=input_dtype,
                  name="index_points",
                  convert_ref=False,
                  allow_packing=True,
              )
          observation_noise_variance = (
              tensor_util.convert_nonref_to_tensor(
                  observation_noise_variance,
                  dtype=dtype,
                  name="observation_noise_variance",
              )
          )
  
          if not isinstance(kernel, multitask_kernel.MultiTaskKernel):
              raise ValueError("`kernel` must be a `MultiTaskKernel`.")
          self._kernel = kernel
          self._index_points = index_points
  
          mean_fn = (
              stochastic_process_util.maybe_create_multitask_mean_fn(
                  mean_fn, kernel, dtype
              )
          )
          self._mean_fn = mean_fn
          # Scalar or vector the size of the number of tasks.
          self._observation_noise_variance = observation_noise_variance
  
          if cholesky_fn is None:
              self._cholesky_fn = (
                  cholesky_util.make_cholesky_with_jitter_fn()
              )
          else:
              if not callable(cholesky_fn):
                  raise ValueError(
                      "`cholesky_fn` must be a Python callable"
                  )
              self._cholesky_fn = cholesky_fn
  
          with tf.name_scope("init"):
              super(MultiTaskGaussianProcess, self).__init__(
                  dtype=dtype,
                  reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
                  validate_args=validate_args,
                  allow_nan_stats=allow_nan_stats,
                  parameters=parameters,
                  name=name,
              )
  
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import cholesky_util
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.distributions.internal import stochastic_process_util
  from tensorflow_probability.python.experimental.linalg import linear_operator_unitary
  from tensorflow_probability.python.experimental.psd_kernels import multitask_kernel
  from tensorflow_probability.python.internal import batch_shape_lib
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new MultiTaskGaussianProcess object from inherited base classes: distribution with example: obj = MultiTaskGaussianProcess(kernel, index_points, mean_fn, observation_noise_variance, cholesky_fn, validate_args, allow_nan_stats, name)