class_docstr: A Student T distribution.
  
  A Student T distribution models the probability of a variable occuring under
  a bell-shaped curve with heavy tails. Basically, this is a version of the
  normal distribution that is less resistant to outliers.  It is described by 
  a vector of mean values and a vector of variance values. This
  distribution can assume that features are independent of the others if
  the covariance type is 'diag' or 'sphere', but if the type is 'full' then
  the features are not independent.
  
  There are two ways to initialize this object. The first is to pass in
  the tensor of probablity parameters, at which point they can immediately be
  used. The second is to not pass in the rate parameters and then call
  either `fit` or `summary` + `from_summaries`, at which point the probability
  parameter will be learned from data.
  
  
  Parameters
  ----------
  means: list, numpy.ndarray, torch.Tensor or None, shape=(d,), optional
          The mean values of the distributions. Default is None.
  
  covs: list, numpy.ndarray, torch.Tensor, or None, optional
          The variances and covariances of the distribution. If covariance_type
          is 'full', the shape should be (self.d, self.d); if 'diag', the shape
          should be (self.d,); if 'sphere', it should be (1,). Note that this is
          the variances or covariances in all settings, and not the standard
          deviation, as may be more common for diagonal covariance matrices.
          Default is None.
  
  covariance_type: str, optional
          The type of covariance matrix. Must be one of 'full', 'diag', or
          'sphere'. Default is 'full'. 
  
  min_cov: float or None, optional
          The minimum variance or covariance.
  
  inertia: float, [0, 1], optional
          Indicates the proportion of the update to apply to the parameters
          during training. When the inertia is 0.0, the update is applied in
          its entirety and the previous parameters are ignored. When the
          inertia is 1.0, the update is entirely ignored and the previous
          parameters are kept, equivalently to if the parameters were frozen.
  
  frozen: bool, optional
          Whether all the parameters associated with this distribution are frozen.
          If you want to freeze individual pameters, or individual values in those
          parameters, you must modify the `frozen` attribute of the tensor or
          parameter directly. Default is False.
  
  check_data: bool, optional
          Whether to check properties of the data and potentially recast it to
          torch.tensors. This does not prevent checking of parameters but can
          slightly speed up computation when you know that your inputs are valid.
          Setting this to False is also necessary for compiling.
class_docstr_tok: ["A","Student","T","distribution",".","A","Student","T","distribution","models","the","probability","of","a","variable","occuring","under","a","bell-shaped","curve","with","heavy","tails",".","Basically",",","this","is","a","version","of","the","normal","distribution","that","is","less","resistant","to","outliers",".","It","is","described","by","a","vector","of","mean","values","and","a","vector","of","variance","values",".","This","distribution","can","assume","that","features","are","independent","of","the","others","if","the","covariance","type","is","'diag","'","or","'sphere","'",",","but","if","the","type","is","'full","'","then","the","features","are","not","independent",".","There","are","two","ways","to","initialize","this","object",".","The","first","is","to","pass","in","the","tensor","of","probablity","parameters",",","at","which","point","they","can","immediately","be","used",".","The","second","is","to","not","pass","in","the","rate","parameters","and","then","call","either","`","fit","`","or","`","summary","`","+","`","from_summaries","`",",","at","which","point","the","probability","parameter","will","be","learned","from","data",".","Parameters","--","--","--","--","--","means",":","list",",","numpy.ndarray",",","torch.Tensor","or","None",",","shape=","(","d",",",")",",","optional","The","mean","values","of","the","distributions",".","Default","is","None",".","covs",":","list",",","numpy.ndarray",",","torch.Tensor",",","or","None",",","optional","The","variances","and","covariances","of","the","distribution",".","If","covariance_type","is","'full","'",",","the","shape","should","be","(","self.d",",","self.d",")",";","if","'diag","'",",","the","shape","should","be","(","self.d",",",")",";","if","'sphere","'",",","it","should","be","(","1",",",")",".","Note","that","this","is","the","variances","or","covariances","in","all","settings",",","and","not","the","standard","deviation",",","as","may","be","more","common","for","diagonal","covariance","matrices",".","Default","is","None",".","covariance_type",":","str",",","optional","The","type","of","covariance","matrix",".","Must","be","one","of","'full","'",",","'diag","'",",","or","'sphere","'",".","Default","is","'full","'",".","min_cov",":","float","or","None",",","optional","The","minimum","variance","or","covariance",".","inertia",":","float",",","[","0",",","1","]",",","optional","Indicates","the","proportion","of","the","update","to","apply","to","the","parameters","during","training",".","When","the","inertia","is","0.0",",","the","update","is","applied","in","its","entirety","and","the","previous","parameters","are","ignored",".","When","the","inertia","is","1.0",",","the","update","is","entirely","ignored","and","the","previous","parameters","are","kept",",","equivalently","to","if","the","parameters","were","frozen",".","frozen",":","bool",",","optional","Whether","all","the","parameters","associated","with","this","distribution","are","frozen",".","If","you","want","to","freeze","individual","pameters",",","or","individual","values","in","those","parameters",",","you","must","modify","the","`","frozen","`","attribute","of","the","tensor","or","parameter","directly",".","Default","is","False",".","check_data",":","bool",",","optional","Whether","to","check","properties","of","the","data","and","potentially","recast","it","to","torch.tensors",".","This","does","not","prevent","checking","of","parameters","but","can","slightly","speed","up","computation","when","you","know","that","your","inputs","are","valid",".","Setting","this","to","False","is","also","necessary","for","compiling","."]
docstr: Sample from the probability distribution.
  
  This method will return `n` samples generated from the underlying
  probability distribution.
  
  
  Parameters
  ----------
  n: int
          The number of samples to generate.
  
  
  Returns
  -------
  X: torch.tensor, shape=(n, self.d)
          Randomly generated samples.
docstr_tok: ["Sample","from","the","probability","distribution",".","This","method","will","return","`","n","`","samples","generated","from","the","underlying","probability","distribution",".","Parameters","--","--","--","--","--","n",":","int","The","number","of","samples","to","generate",".","Returns","--","--","--","-","X",":","torch.tensor",",","shape=","(","n",",","self.d",")","Randomly","generated","samples","."]
code: def sample(self, n):
      """Sample from the probability distribution.
  
      This method will return `n` samples generated from the underlying
      probability distribution.
  
  
      Parameters
      ----------
      n: int
              The number of samples to generate.
  
  
      Returns
      -------
      X: torch.tensor, shape=(n, self.d)
              Randomly generated samples.
      """
  
      return torch.distributions.StudentT(self.means, self.covs).sample(
          [n]
      )
  
file_path: pomegranate/pomegranate/distributions/student_t.py
imports: import math
  import torch
  from .._utils import _cast_as_tensor
  from .._utils import _cast_as_parameter
  from .._utils import _update_parameter
  from .._utils import _check_parameter
  from .normal import Normal
label_desc: Use image node_id 3 for calling the StudentT obj's underlying member method code with example usage: obj.sample(n) and returns: torch