class_docstr: A time series model in which each output dimension is modeled independently
  with a univariate Gaussian Process with a Matern kernel. The targets are assumed
  to be evenly spaced in time. Training and inference are logarithmic in the length
  of the time series T.
  
  :param float nu: The order of the Matern kernel; one of 0.5, 1.5 or 2.5.
  :param float dt: The time spacing between neighboring observations of the time series.
  :param int obs_dim: The dimension of the targets at each time step.
  :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
class_docstr_tok: ["A","time","series","model","in","which","each","output","dimension","is","modeled","independently","with","a","univariate","Gaussian","Process","with","a","Matern","kernel",".","The","targets","are","assumed","to","be","evenly","spaced","in","time",".","Training","and","inference","are","logarithmic","in","the","length","of","the","time","series","T.",":","param","float","nu",":","The","order","of","the","Matern","kernel",";","one","of","0.5",",","1.5","or","2.5.",":","param","float","dt",":","The","time","spacing","between","neighboring","observations","of","the","time","series",".",":","param","int","obs_dim",":","The","dimension","of","the","targets","at","each","time","step",".",":","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"]
docstr: Get the :class:`~pyro.distributions.GaussianHMM` distribution that corresponds
  to ``obs_dim``-many independent Matern GPs.
  
  :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","``","obs_dim","``","-many","independent","Matern","GPs",".",":","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 ``obs_dim``-many independent Matern GPs.
  
      :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.
      """
      (
          trans_matrix,
          process_covar,
      ) = self.kernel.transition_matrix_and_covariance(dt=self.dt)
      trans_dist = MultivariateNormal(
          self.obs_matrix.new_zeros(
              self.obs_dim, 1, self.kernel.state_dim
          ),
          process_covar.unsqueeze(-3),
      )
      trans_matrix = trans_matrix.unsqueeze(-3)
      return dist.GaussianHMM(
          self._get_init_dist(),
          trans_matrix,
          trans_dist,
          self.obs_matrix,
          self._get_obs_dist(),
          duration=duration,
      )
  
imports: import math
  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
label_desc: Use image node_id 4 for calling the IndependentMaternGP obj's underlying member method code with example usage: obj.get_dist(duration) and returns: dist