class_docstr: A generic Linear Gaussian State Space Model parameterized with arbitrary time invariant
  transition and observation dynamics. The targets are (implicitly) assumed to be evenly
  spaced in time. 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 latent state at each time step.
  :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",".","The","targets","are","(","implicitly",")","assumed","to","be","evenly","spaced","in","time",".","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","latent","state","at","each","time","step",".",":","param","bool","learnable_observation_loc",":","whether","the","mean","of","the","observation","model","should","be","learned","or","not",";","defaults","to","False","."]
code: def __init__(
      self,
      obs_dim=1,
      state_dim=2,
      obs_noise_scale_init=None,
      learnable_observation_loc=False,
  ):
      self.obs_dim = obs_dim
      self.state_dim = state_dim
  
      if obs_noise_scale_init is None:
          obs_noise_scale_init = 0.2 * torch.ones(obs_dim)
      assert obs_noise_scale_init.shape == (obs_dim,)
  
      super().__init__()
  
      self.obs_noise_scale = PyroParam(
          obs_noise_scale_init, constraint=constraints.positive
      )
      self.trans_noise_scale_sq = PyroParam(
          torch.ones(state_dim), constraint=constraints.positive
      )
      self.trans_matrix = nn.Parameter(
          torch.eye(state_dim)
          + 0.03 * torch.randn(state_dim, state_dim)
      )
      self.obs_matrix = nn.Parameter(
          0.3 * torch.randn(state_dim, obs_dim)
      )
      self.init_noise_scale_sq = PyroParam(
          torch.ones(state_dim), constraint=constraints.positive
      )
  
      if learnable_observation_loc:
          self.obs_loc = nn.Parameter(torch.zeros(obs_dim))
      else:
          self.register_buffer("obs_loc", torch.zeros(obs_dim))
  
file_path: pyro/pyro/contrib/timeseries/lgssm.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.tensor_utils import repeated_matmul
label_desc: Use image node_id 1 to create a new GenericLGSSM object from inherited base classes: TimeSeriesModel with example: obj = GenericLGSSM(obs_dim, state_dim, obs_noise_scale_init, learnable_observation_loc)