class_docstr: The Power Spherical distribution over unit vectors on `S^{n-1}`.
  
  The Power Spherical distribution [1] is a distribution over vectors
  on the unit hypersphere `S^{n-1}` embedded in `n` dimensions (`R^n`).
  
  It serves as an alternative to the von Mises-Fisher distribution with a
  simpler (faster) `log_prob` calculation, as well as a reparameterizable
  sampler. In contrast, the Power Spherical distribution does have
  `-mean_direction` as a point with zero density (and hence a neighborhood
  around that having arbitrarily small density), in contrast with the
  von Mises-Fisher distribution which has non-zero density everywhere.
  
  NOTE: `mean_direction` is not in general the mean of the distribution. For
  spherical distributions, the mean is generally not in the support of the
  distribution.
  
  #### Mathematical details
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; mu, kappa) = C(kappa) (1 + mu^T x) ** kappa
  where,
  C(kappa) = 2**(a + b) pi**b Gamma(a) / Gamma(a + b)
  a = (n - 1) / 2. + kappa
  b = (n - 1) / 2.
  ```
  
  where:
  * `mean_direction = mu`; a unit vector in `R^n`,
  * `concentration = kappa`; scalar real >= 0, concentration of samples around
    `mean_direction`, where 0 pertains to the uniform distribution on the
    hypersphere, and \inf indicates a delta function at `mean_direction`.
  
  #### Examples
  
  A single instance of a PowerSpherical distribution is defined by a mean
  direction unit vector.
  
  Extra leading dimensions, if provided, allow for batches.
  
  ```python
  tfd = tfp.distributions
  
  # Initialize a single 3-dimension PowerSpherical distribution.
  mu = [0., 1, 0]
  conc = 1.
  ps = tfd.PowerSpherical(mean_direction=mu, concentration=conc)
  
  # Evaluate this on an observation in S^2 (in R^3), returning a scalar.
  ps.prob([1., 0, 0])
  
  # Initialize a batch of two 3-variate vMF distributions.
  mu = [[0., 1, 0],
        [1., 0, 0]]
  conc = [1., 2]
  ps = tfd.PowerSpherical(mean_direction=mu, concentration=conc)
  
  # Evaluate this on two observations, each in S^2, returning a length two
  # tensor.
  x = [[0., 0, 1],
       [0., 1, 0]]
  ps.prob(x)
  ```
  
  #### References
  
  [1] Nicola de Cao, Wilker Aziz. The Power Spherical distribution.
      https://arxiv.org/abs/2006.04437.
class_docstr_tok: ["The","Power","Spherical","distribution","over","unit","vectors","on","`","S^","{","n-1","}","`",".","The","Power","Spherical","distribution","[","1","]","is","a","distribution","over","vectors","on","the","unit","hypersphere","`","S^","{","n-1","}","`","embedded","in","`","n","`","dimensions","(","`","R^n","`",")",".","It","serves","as","an","alternative","to","the","von","Mises-Fisher","distribution","with","a","simpler","(","faster",")","`","log_prob","`","calculation",",","as","well","as","a","reparameterizable","sampler",".","In","contrast",",","the","Power","Spherical","distribution","does","have","`","-mean_direction","`","as","a","point","with","zero","density","(","and","hence","a","neighborhood","around","that","having","arbitrarily","small","density",")",",","in","contrast","with","the","von","Mises-Fisher","distribution","which","has","non-zero","density","everywhere",".","NOTE",":","`","mean_direction","`","is","not","in","general","the","mean","of","the","distribution",".","For","spherical","distributions",",","the","mean","is","generally","not","in","the","support","of","the","distribution",".","#","#","#","#","Mathematical","details","The","probability","density","function","(","pdf",")","is",",","``","`","none","pdf","(","x",";","mu",",","kappa",")","=","C","(","kappa",")","(","1","+","mu^T","x",")","*","*","kappa","where",",","C","(","kappa",")","=","2","*","*","(","a","+","b",")","pi","*","*","b","Gamma","(","a",")","\/","Gamma","(","a","+","b",")","a","=","(","n","-","1",")","\/","2",".","+","kappa","b","=","(","n","-","1",")","\/","2",".","``","`","where",":","*","`","mean_direction","=","mu","`",";","a","unit","vector","in","`","R^n","`",",","*","`","concentration","=","kappa","`",";","scalar","real",">","=","0",",","concentration","of","samples","around","`","mean_direction","`",",","where","0","pertains","to","the","uniform","distribution","on","the","hypersphere",",","and","\\inf","indicates","a","delta","function","at","`","mean_direction","`",".","#","#","#","#","Examples","A","single","instance","of","a","PowerSpherical","distribution","is","defined","by","a","mean","direction","unit","vector",".","Extra","leading","dimensions",",","if","provided",",","allow","for","batches",".","``","`","python","tfd","=","tfp.distributions","#","Initialize","a","single","3-dimension","PowerSpherical","distribution",".","mu","=","[","0.",",","1",",","0","]","conc","=","1.","ps","=","tfd.PowerSpherical","(","mean_direction=mu",",","concentration=conc",")","#","Evaluate","this","on","an","observation","in","S^2","(","in","R^3",")",",","returning","a","scalar",".","ps.prob","(","[","1.",",","0",",","0","]",")","#","Initialize","a","batch","of","two","3-variate","vMF","distributions",".","mu","=","[","[","0.",",","1",",","0","]",",","[","1.",",","0",",","0","]","]","conc","=","[","1.",",","2","]","ps","=","tfd.PowerSpherical","(","mean_direction=mu",",","concentration=conc",")","#","Evaluate","this","on","two","observations",",","each","in","S^2",",","returning","a","length","two","#","tensor",".","x","=","[","[","0.",",","0",",","1","]",",","[","0.",",","1",",","0","]","]","ps.prob","(","x",")","``","`","#","#","#","#","References","[","1","]","Nicola","de","Cao",",","Wilker","Aziz",".","The","Power","Spherical","distribution",".","https",":","\/\/arxiv.org\/abs\/2006.04437","."]
code: def _log_prob(self, x):
      concentration = tf.convert_to_tensor(self.concentration)
      return self._log_unnormalized_prob(
          x, concentration=concentration
      ) - self._log_normalization(concentration=concentration)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.bijectors import square
  from tensorflow_probability.python.distributions import beta
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import spherical_uniform
  from tensorflow_probability.python.distributions import von_mises_fisher
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import special
  from tensorflow_probability.python.random import random_ops
label_desc: Use image node_id 7 for calling the PowerSpherical obj's underlying member method code with example usage: obj._log_prob(x) and returns: unknown