class_docstr: Inverse Wishart prior over n x n positive definite matrices
  
  pdf(Sigma) \sim |Sigma|^-(nu + 2 * n)/2 * exp(-0.5 * Trace(K Sigma^-1))
  
  where nu > 0 are the degrees of freedom and K > 0 is the p x p scale matrix
  
  Reference: A. Shah, A. G. Wilson, and Z. Ghahramani. Student-t Processes as
      Alternatives to Gaussian Processes. ArXiv e-prints, Feb. 2014.
class_docstr_tok: ["Inverse","Wishart","prior","over","n","x","n","positive","definite","matrices","pdf","(","Sigma",")","\\sim","|Sigma|^-","(","nu","+","2","*","n",")","\/2","*","exp","(","-0.5","*","Trace","(","K","Sigma^-1",")",")","where","nu",">","0","are","the","degrees","of","freedom","and","K",">","0","is","the","p","x","p","scale","matrix","Reference",":","A.","Shah",",","A.","G.","Wilson",",","and","Z.","Ghahramani",".","Student-t","Processes","as","Alternatives","to","Gaussian","Processes",".","ArXiv","e-prints",",","Feb.","2014","."]
code: def __init__(self, nu, K, validate_args=False):
      TModule.__init__(self)
      if K.dim() < 2:
          raise ValueError("K must be at least 2-dimensional")
      n = K.shape[-1]
      if isinstance(nu, Number):
          nu = torch.tensor(float(nu))
      if torch.any(nu <= 0):
          raise ValueError("Must have nu > 0")
      self.n = torch.tensor(n, dtype=torch.long, device=nu.device)
      batch_shape = nu.shape
      event_shape = torch.Size([n, n])
      # normalization constant
      c = (nu + n - 1) / 2
      logdetK = torch.logdet(K)
      C = c * (logdetK - n * math.log(2)) - torch.mvlgamma(c, n)
      # need to assign values before registering as buffers to make argument validation work
      self.nu = nu
      self.K = K
      self.C = C
      super(InverseWishartPrior, self).__init__(
          batch_shape, event_shape, validate_args=validate_args
      )
      # now need to delete to be able to register buffer
      del self.nu, self.K, self.C
      self.register_buffer("nu", nu)
      self.register_buffer("K", K)
      self.register_buffer("C", C)
  
file_path: gpytorch/gpytorch/priors/wishart_prior.py
imports: import math
  from numbers import Number
  import torch
  from torch.distributions import constraints
  from torch.nn import Module
  from .prior import Prior
label_desc: Use image node_id 1 to create a new InverseWishartPrior object from inherited base classes: Prior with example: obj = InverseWishartPrior(nu, K, validate_args)