class_docstr: A generic Linear Gaussian State Space Model parameterized with arbitrary time invariant
  transition and observation dynamics together with separate Gaussian Process noise models
  for each output dimension. In more detail, the generative process is:
  
      :math:`y_i(t) = \sum_j A_{ij} z_j(t) + f_i(t) + \epsilon_i(t)`
  
  where the latent variables :math:`{\bf z}(t)` follow generic time invariant Linear Gaussian dynamics
  and the :math:`f_i(t)` are Gaussian Processes with Matern kernels.
  
  The targets are (implicitly) assumed to be evenly spaced in time. In particular a timestep of
  :math:`dt=1.0` for the continuous-time GP dynamics corresponds to a single discrete step of
  the :math:`{\bf z}`-space dynamics. Training and inference are logarithmic in the length of
  the time series T.
  
  :param int obs_dim: The dimension of the targets at each time step.
  :param int state_dim: The dimension of the :math:`{\bf z}` latent state at each time step.
  :param float nu: The order of the Matern kernel; one of 0.5, 1.5 or 2.5.
  :param torch.Tensor length_scale_init: optional initial values for the kernel length scale
      given as a ``obs_dim``-dimensional tensor
  :param torch.Tensor kernel_scale_init: optional initial values for the kernel scale
      given as a ``obs_dim``-dimensional tensor
  :param torch.Tensor obs_noise_scale_init: optional initial values for the observation noise scale
      given as a ``obs_dim``-dimensional tensor
  :param bool learnable_observation_loc: whether the mean of the observation model should be learned or not;
          defaults to False.
class_docstr_tok: ["A","generic","Linear","Gaussian","State","Space","Model","parameterized","with","arbitrary","time","invariant","transition","and","observation","dynamics","together","with","separate","Gaussian","Process","noise","models","for","each","output","dimension",".","In","more","detail",",","the","generative","process","is",":",":","math",":","`","y_i","(","t",")","=","\\sum_j","A_","{","ij","}","z_j","(","t",")","+","f_i","(","t",")","+","\\epsilon_i","(","t",")","`","where","the","latent","variables",":","math",":","`","{","\\bf","z","}","(","t",")","`","follow","generic","time","invariant","Linear","Gaussian","dynamics","and","the",":","math",":","`","f_i","(","t",")","`","are","Gaussian","Processes","with","Matern","kernels",".","The","targets","are","(","implicitly",")","assumed","to","be","evenly","spaced","in","time",".","In","particular","a","timestep","of",":","math",":","`","dt=1.0","`","for","the","continuous-time","GP","dynamics","corresponds","to","a","single","discrete","step","of","the",":","math",":","`","{","\\bf","z","}","`","-space","dynamics",".","Training","and","inference","are","logarithmic","in","the","length","of","the","time","series","T.",":","param","int","obs_dim",":","The","dimension","of","the","targets","at","each","time","step",".",":","param","int","state_dim",":","The","dimension","of","the",":","math",":","`","{","\\bf","z","}","`","latent","state","at","each","time","step",".",":","param","float","nu",":","The","order","of","the","Matern","kernel",";","one","of","0.5",",","1.5","or","2.5.",":","param","torch.Tensor","length_scale_init",":","optional","initial","values","for","the","kernel","length","scale","given","as","a","``","obs_dim","``","-dimensional","tensor",":","param","torch.Tensor","kernel_scale_init",":","optional","initial","values","for","the","kernel","scale","given","as","a","``","obs_dim","``","-dimensional","tensor",":","param","torch.Tensor","obs_noise_scale_init",":","optional","initial","values","for","the","observation","noise","scale","given","as","a","``","obs_dim","``","-dimensional","tensor",":","param","bool","learnable_observation_loc",":","whether","the","mean","of","the","observation","model","should","be","learned","or","not",";","defaults","to","False","."]
docstr: Get the :class:`~pyro.distributions.GaussianHMM` distribution that corresponds
  to :class:`GenericLGSSMWithGPNoiseModel`.
  
  :param int duration: Optional size of the time axis ``event_shape[0]``.
      This is required when sampling from homogeneous HMMs whose parameters
      are not expanded along the time axis.
docstr_tok: ["Get","the",":","class",":","`","~pyro.distributions.GaussianHMM","`","distribution","that","corresponds","to",":","class",":","`","GenericLGSSMWithGPNoiseModel","`",".",":","param","int","duration",":","Optional","size","of","the","time","axis","``","event_shape","[","0","]","``",".","This","is","required","when","sampling","from","homogeneous","HMMs","whose","parameters","are","not","expanded","along","the","time","axis","."]
code: def get_dist(self, duration=None):
      """
      Get the :class:`~pyro.distributions.GaussianHMM` distribution that corresponds
      to :class:`GenericLGSSMWithGPNoiseModel`.
  
      :param int duration: Optional size of the time axis ``event_shape[0]``.
          This is required when sampling from homogeneous HMMs whose parameters
          are not expanded along the time axis.
      """
      (
          gp_trans_matrix,
          gp_process_covar,
      ) = self.kernel.transition_matrix_and_covariance(dt=self.dt)
  
      trans_covar = self.z_trans_matrix.new_zeros(
          self.full_state_dim, self.full_state_dim
      )
      trans_covar[
          : self.full_gp_state_dim, : self.full_gp_state_dim
      ] = block_diag_embed(gp_process_covar)
      trans_covar[
          self.full_gp_state_dim :, self.full_gp_state_dim :
      ] = self.trans_noise_scale_sq.diag_embed()
      trans_dist = MultivariateNormal(
          trans_covar.new_zeros(self.full_state_dim), trans_covar
      )
  
      full_trans_mat = trans_covar.new_zeros(
          self.full_state_dim, self.full_state_dim
      )
      full_trans_mat[
          : self.full_gp_state_dim, : self.full_gp_state_dim
      ] = block_diag_embed(gp_trans_matrix)
      full_trans_mat[
          self.full_gp_state_dim :, self.full_gp_state_dim :
      ] = self.z_trans_matrix
  
      return dist.GaussianHMM(
          self._get_init_dist(),
          full_trans_mat,
          trans_dist,
          self._get_obs_matrix(),
          self._get_obs_dist(),
          duration=duration,
      )
  
file_path: pyro/pyro/contrib/timeseries/lgssmgp.py
imports: import torch
  import torch.nn
  from torch.distributions import MultivariateNormal, constraints
  import pyro.distributions
  from pyro.contrib.timeseries.base import TimeSeriesModel
  from pyro.nn import PyroParam, pyro_method
  from pyro.ops.ssm_gp import MaternKernel
  from pyro.ops.tensor_utils import block_diag_embed, repeated_matmul
label_desc: Use image node_id 5 for calling the GenericLGSSMWithGPNoiseModel obj's underlying member method code with example usage: obj.get_dist(duration) and returns: dist