class_docstr: Horseshoe distribution.
  
  The so-called 'horseshoe' distribution is a Cauchy-Normal scale mixture,
  proposed as a sparsity-inducing prior for Bayesian regression. [1] It is
  symmetric around zero, has heavy (Cauchy-like) tails, so that large
  coefficients face relatively little shrinkage, but an infinitely tall spike at
  0, which pushes small coefficients towards zero. It is parameterized by a
  positive scalar `scale` parameter: higher values yield a weaker
  sparsity-inducing effect.
  
  #### Mathematical details
  
  The Horseshoe distribution is centered at zero, with scale parameter
  \\(\lambda\\). It is defined by: \
  \\(
  X \sim \text {Horseshoe}(scale=\lambda) \, \equiv \, X \sim \text{Normal}
  (0, \, \lambda \cdot \sigma) \quad \text{where} \quad \sigma \sim
  \text{HalfCauchy} (0, \,1)
  \\)
  
  The probability density function, \
  \\(
  \pi_\lambda(x) = \int_0^\infty \, \frac{1}{\sqrt{ 2\pi \lambda^2 t^2 }} \,
  \exp \left\{ -\frac{x^2}{2\lambda^2t^2} \right\} \,
  \frac{2}{\pi\left(1+t^2\right)} \mathrm{d} t
  \\)
  
  can be rewritten [1] as \
  \\(
  \pi_\lambda(x) = \frac{1}{\sqrt{2 \pi^3 \lambda^2}} \, \exp \left\{
  \frac{x^2}{2\lambda^2} \right\} \, E_1\left(\frac{x^2}{2\lambda^2}\right)
  \\)
  
  where E<sub>1</sub>(.) is the [exponential integral function][wiki1] which can
  be approximated by elementary functions. [2]
  
  #### Examples
  
  Examples of initialization of one or a batch of distributions.
  
  ```python
  # Define a single scalar Horseshoe distribution.
  dist = tfp.distributions.Horseshoe(scale=3.0)
  
  # Evaluate the log_prob at 1, returning a scalar.
  dist.log_prob(1.)
  
  # Define a batch of two scalar valued Horseshoes.
  # The first has scale 11.0, the second 22.0
  dist = tfp.distributions.Horseshoe(scale=[11.0, 22.0])
  
  # Evaluate the log_prob of the first distribution on 1.0, and the second on
  # 1.5, returning a length two tensor.
  dist.log_prob([1.0, 1.5])
  
  # Evaluate the log_prob of both distributions at 2.0 and 2.5, returning a
  # 2 x 2 tensor.
  dist.log_prob([[2.0], [2.5]])
  
  # Get 3 samples, returning a 3 x 2 tensor.
  dist.sample([3])
  ```
  
  #### References
  
  [1] Carvalho, Polson, Scott.
  [Handling Sparsity via the Horseshoe (2008)][link1].
  
  [2] Barry, Parlange, Li.
  [Approximation for the exponential integral (2000)][link2]. Formula from
  [Wikipedia][wiki2].
  
  [link1]:
      http://faculty.chicagobooth.edu/nicholas.polson/research/papers/Horse.pdf
  [link2]: https://doi.org/10.1016/S0022-1694(99)00184-5
  [wiki1]: https://en.wikipedia.org/wiki/Exponential_integral
  [wiki2]: https://en.wikipedia.org/wiki/Exponential_integral#cite_note-17
class_docstr_tok: ["Horseshoe","distribution",".","The","so-called","'horseshoe","'","distribution","is","a","Cauchy-Normal","scale","mixture",",","proposed","as","a","sparsity-inducing","prior","for","Bayesian","regression",".","[","1","]","It","is","symmetric","around","zero",",","has","heavy","(","Cauchy-like",")","tails",",","so","that","large","coefficients","face","relatively","little","shrinkage",",","but","an","infinitely","tall","spike","at","0",",","which","pushes","small","coefficients","towards","zero",".","It","is","parameterized","by","a","positive","scalar","`","scale","`","parameter",":","higher","values","yield","a","weaker","sparsity-inducing","effect",".","#","#","#","#","Mathematical","details","The","Horseshoe","distribution","is","centered","at","zero",",","with","scale","parameter","\\\\","(","\\lambda\\\\",")",".","It","is","defined","by",":","\\","\\\\","(","X","\\sim","\\text","{","Horseshoe","}","(","scale=\\lambda",")","\\",",","\\equiv","\\",",","X","\\sim","\\text","{","Normal","}","(","0",",","\\",",","\\lambda","\\cdot","\\sigma",")","\\quad","\\text","{","where","}","\\quad","\\sigma","\\sim","\\text","{","HalfCauchy","}","(","0",",","\\,1",")","\\\\",")","The","probability","density","function",",","\\","\\\\","(","\\pi_\\lambda","(","x",")","=","\\int_0^\\infty","\\",",","\\frac","{","1","}","{","\\sqrt","{","2\\pi","\\lambda^2","t^2","}","}","\\",",","\\exp","\\left\\","{","-\\frac","{","x^2","}","{","2\\lambda^2t^2","}","\\right\\","}","\\",",","\\frac","{","2","}","{","\\pi\\left","(","1+t^2\\right",")","}","\\mathrm","{","d","}","t","\\\\",")","can","be","rewritten","[","1","]","as","\\","\\\\","(","\\pi_\\lambda","(","x",")","=","\\frac","{","1","}","{","\\sqrt","{","2","\\pi^3","\\lambda^2","}","}","\\",",","\\exp","\\left\\","{","\\frac","{","x^2","}","{","2\\lambda^2","}","\\right\\","}","\\",",","E_1\\left","(","\\frac","{","x^2","}","{","2\\lambda^2","}","\\right",")","\\\\",")","where","E","<","sub",">","1","<","\/sub",">","(",".",")","is","the","[","exponential","integral","function","]","[","wiki1","]","which","can","be","approximated","by","elementary","functions",".","[","2","]","#","#","#","#","Examples","Examples","of","initialization","of","one","or","a","batch","of","distributions",".","``","`","python","#","Define","a","single","scalar","Horseshoe","distribution",".","dist","=","tfp.distributions.Horseshoe","(","scale=3.0",")","#","Evaluate","the","log_prob","at","1",",","returning","a","scalar",".","dist.log_prob","(","1",".",")","#","Define","a","batch","of","two","scalar","valued","Horseshoes",".","#","The","first","has","scale","11.0",",","the","second","22.0","dist","=","tfp.distributions.Horseshoe","(","scale=","[","11.0",",","22.0","]",")","#","Evaluate","the","log_prob","of","the","first","distribution","on","1.0",",","and","the","second","on","#","1.5",",","returning","a","length","two","tensor",".","dist.log_prob","(","[","1.0",",","1.5","]",")","#","Evaluate","the","log_prob","of","both","distributions","at","2.0","and","2.5",",","returning","a","#","2","x","2","tensor",".","dist.log_prob","(","[","[","2.0","]",",","[","2.5","]","]",")","#","Get","3","samples",",","returning","a","3","x","2","tensor",".","dist.sample","(","[","3","]",")","``","`","#","#","#","#","References","[","1","]","Carvalho",",","Polson",",","Scott",".","[","Handling","Sparsity","via","the","Horseshoe","(","2008",")","]","[","link1","]",".","[","2","]","Barry",",","Parlange",",","Li",".","[","Approximation","for","the","exponential","integral","(","2000",")","]","[","link2","]",".","Formula","from","[","Wikipedia","]","[","wiki2","]",".","[","link1","]",":","http",":","\/\/faculty.chicagobooth.edu\/nicholas.polson\/research\/papers\/Horse.pdf","[","link2","]",":","https",":","\/\/doi.org\/10.1016\/S0022-1694","(","99",")","00184-5","[","wiki1","]",":","https",":","\/\/en.wikipedia.org\/wiki\/Exponential_integral","[","wiki2","]",":","https",":","\/\/en.wikipedia.org\/wiki\/Exponential_integral","#","cite_note-17"]
code: def _default_event_space_bijector(self):
      # TODO(b/145620027) Finalize choice of bijector.
      return identity_bijector.Identity(
          validate_args=self.validate_args
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import half_cauchy
  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
label_desc: Use image node_id 12 for calling the Horseshoe obj's underlying member method code with example usage: obj._default_event_space_bijector() and returns: identity_bijector