class_docstr: Mixture of Normal distributions with zero mean and diagonal covariance
  matrices.
  
  That is, this distribution is a mixture with K components, where each
  component distribution is a D-dimensional Normal distribution with zero
  mean and a D-dimensional diagonal covariance matrix. The K different
  covariance matrices are controlled by the parameters `coord_scale` and
  `component_scale`.  That is, the covariance matrix of the k'th component is
  given by
  
  Sigma_ii = (component_scale_k * coord_scale_i) ** 2   (i = 1, ..., D)
  
  where `component_scale_k` is a positive scale factor and `coord_scale_i`
  are positive scale parameters shared between all K components. The mixture
  weights are controlled by a K-dimensional vector of softmax logits,
  `component_logits`. This distribution implements pathwise derivatives for
  samples from the distribution. This distribution does not currently
  support batched parameters.
  
  See reference [1] for details on the implementations of the pathwise
  derivative. Please consider citing this reference if you use the pathwise
  derivative in your research.
  
  [1] Pathwise Derivatives for Multivariate Distributions, Martin Jankowiak &
  Theofanis Karaletsos. arXiv:1806.01856
  
  Note that this distribution supports both even and odd dimensions, but the
  former should be more a bit higher precision, since it doesn't use any erfs
  in the backward call. Also note that this distribution does not support
  D = 1.
  
  :param torch.tensor coord_scale: D-dimensional vector of scales
  :param torch.tensor component_logits: K-dimensional vector of logits
  :param torch.tensor component_scale: K-dimensional vector of scale multipliers
class_docstr_tok: ["Mixture","of","Normal","distributions","with","zero","mean","and","diagonal","covariance","matrices",".","That","is",",","this","distribution","is","a","mixture","with","K","components",",","where","each","component","distribution","is","a","D-dimensional","Normal","distribution","with","zero","mean","and","a","D-dimensional","diagonal","covariance","matrix",".","The","K","different","covariance","matrices","are","controlled","by","the","parameters","`","coord_scale","`","and","`","component_scale","`",".","That","is",",","the","covariance","matrix","of","the","k'th","component","is","given","by","Sigma_ii","=","(","component_scale_k","*","coord_scale_i",")","*","*","2","(","i","=","1",",","...",",","D",")","where","`","component_scale_k","`","is","a","positive","scale","factor","and","`","coord_scale_i","`","are","positive","scale","parameters","shared","between","all","K","components",".","The","mixture","weights","are","controlled","by","a","K-dimensional","vector","of","softmax","logits",",","`","component_logits","`",".","This","distribution","implements","pathwise","derivatives","for","samples","from","the","distribution",".","This","distribution","does","not","currently","support","batched","parameters",".","See","reference","[","1","]","for","details","on","the","implementations","of","the","pathwise","derivative",".","Please","consider","citing","this","reference","if","you","use","the","pathwise","derivative","in","your","research",".","[","1","]","Pathwise","Derivatives","for","Multivariate","Distributions",",","Martin","Jankowiak","&","Theofanis","Karaletsos",".","arXiv:1806.01856","Note","that","this","distribution","supports","both","even","and","odd","dimensions",",","but","the","former","should","be","more","a","bit","higher","precision",",","since","it","does","n't","use","any","erfs","in","the","backward","call",".","Also","note","that","this","distribution","does","not","support","D","=","1.",":","param","torch.tensor","coord_scale",":","D-dimensional","vector","of","scales",":","param","torch.tensor","component_logits",":","K-dimensional","vector","of","logits",":","param","torch.tensor","component_scale",":","K-dimensional","vector","of","scale","multipliers"]
code: def log_prob(self, value):
      assert value.dim() == 1 and value.size(0) == self.dim
      epsilon_sqr = torch.pow(value / self.coord_scale, 2.0).sum()
      component_scale_log_power = self.component_scale.log() * -self.dim
      # logits in Categorical is already normalized
      result = torch.logsumexp(
          component_scale_log_power
          + self.categorical.logits
          + -0.5 * epsilon_sqr / torch.pow(self.component_scale, 2.0),
          dim=-1,
      )  # K
      result -= 0.5 * math.log(2.0 * math.pi) * float(self.dim)
      result -= self.coord_scale.log().sum()
      return result
  
file_path: pyro/pyro/distributions/gaussian_scale_mixture.py
imports: import math
  import torch
  from torch.autograd import Function
  from torch.autograd.function import once_differentiable
  from torch.distributions import Categorical, constraints
  from pyro.distributions.torch_distribution import TorchDistribution
  from pyro.distributions.util import sum_leftmost
label_desc: Use image node_id 3 for calling the GaussianScaleMixture obj's underlying member method code with example usage: obj.log_prob(value) and returns: result