class_docstr: Provides the building blocks for representing univariate Gaussian Processes (GPs)
  with Matern kernels as state space models.
  
  :param float nu: The order of the Matern kernel (one of 0.5, 1.5 or 2.5)
  :param int num_gps: the number of GPs
  :param torch.Tensor length_scale_init: optional `num_gps`-dimensional vector of initializers
      for the length scale
  :param torch.Tensor kernel_scale_init: optional `num_gps`-dimensional vector of initializers
      for the kernel scale
  
  **References**
  
  [1] `Kalman Filtering and Smoothing Solutions to Temporal Gaussian Process Regression Models`,
      Jouni Hartikainen and Simo Sarkka.
  [2] `Stochastic Differential Equation Methods for Spatio-Temporal Gaussian Process Regression`,
      Arno Solin.
class_docstr_tok: ["Provides","the","building","blocks","for","representing","univariate","Gaussian","Processes","(","GPs",")","with","Matern","kernels","as","state","space","models",".",":","param","float","nu",":","The","order","of","the","Matern","kernel","(","one","of","0.5",",","1.5","or","2.5",")",":","param","int","num_gps",":","the","number","of","GPs",":","param","torch.Tensor","length_scale_init",":","optional","`","num_gps","`","-dimensional","vector","of","initializers","for","the","length","scale",":","param","torch.Tensor","kernel_scale_init",":","optional","`","num_gps","`","-dimensional","vector","of","initializers","for","the","kernel","scale","*","*","References","*","*","[","1","]","`","Kalman","Filtering","and","Smoothing","Solutions","to","Temporal","Gaussian","Process","Regression","Models","`",",","Jouni","Hartikainen","and","Simo","Sarkka",".","[","2","]","`","Stochastic","Differential","Equation","Methods","for","Spatio-Temporal","Gaussian","Process","Regression","`",",","Arno","Solin","."]
code: def __init__(
      self,
      nu=1.5,
      num_gps=1,
      length_scale_init=None,
      kernel_scale_init=None,
  ):
      if nu not in [0.5, 1.5, 2.5]:
          raise NotImplementedError(
              "The only supported values of nu are 0.5, 1.5 and 2.5"
          )
      self.nu = nu
      self.state_dim = {0.5: 1, 1.5: 2, 2.5: 3}[nu]
      self.num_gps = num_gps
  
      if length_scale_init is None:
          length_scale_init = torch.ones(num_gps)
      assert length_scale_init.shape == (num_gps,)
  
      if kernel_scale_init is None:
          kernel_scale_init = torch.ones(num_gps)
      assert kernel_scale_init.shape == (num_gps,)
  
      super().__init__()
  
      self.length_scale = PyroParam(
          length_scale_init, constraint=constraints.positive
      )
      self.kernel_scale = PyroParam(
          kernel_scale_init, constraint=constraints.positive
      )
  
      if self.state_dim > 1:
          for x in range(self.state_dim):
              for y in range(self.state_dim):
                  mask = torch.zeros(self.state_dim, self.state_dim)
                  mask[x, y] = 1.0
                  self.register_buffer("mask{}{}".format(x, y), mask)
  
file_path: pyro/pyro/ops/ssm_gp.py
imports: import math
  import torch
  from torch.distributions import constraints
  from pyro.nn import PyroModule, PyroParam, pyro_method
label_desc: Use image node_id 1 to create a new MaternKernel object from inherited base classes: PyroModule with example: obj = MaternKernel(nu, num_gps, length_scale_init, kernel_scale_init)