class_docstr: Double-sided Maxwell distribution.
  
  This distribution is useful to compute measure valued derivatives for Gaussian
  distributions. See [Mohamed et al. 2019][1] for more details.
  
  #### Mathematical details
  
  The double-sided Maxwell distribution generalizes the Maxwell distribution to
  the entire real line.
  
  ```none
  pdf(x; mu, sigma) = 1/(sigma*sqrt(2*pi)) * ((x-mu)/sigma)^2
                     * exp(-0.5 ((x-mu)/sigma)^2)
  ```
  
  where `loc = mu` and `scale = sigma`.
  
  The DoublesidedMaxwell distribution is a member of the
  [location-scale family](https://en.wikipedia.org/wiki/Location-scale_family),
  i.e., it can be constructed as,
  
  ```none
  X ~ DoublesidedMaxwell(loc=0, scale=1)
  Y = loc + scale * X
  ```
  
  The double-sided Maxwell is a symmetric distribution that extends the
  one-sided maxwell from R+ to the entire real line. Their densities are
  therefore the same up to a factor of 0.5.
  
  It has several methods for generating random variates from it. The version
  here uses 3 Gaussian variates and a uniform variate to generate the samples
  The sampling path is:
  mu + sigma* sgn(U-0.5)* sqrt(X^2 + Y^2 + Z^2) U~Unif; X,Y,Z ~N(0,1)
  
  In the sampling process above, the random variates generated by
  sqrt(X^2 + Y^2 + Z^2) are samples from the one-sided Maxwell
  (or Maxwell-Boltzmann) distribution.
  
  #### Examples
  
  ```python
  import tensorflow_probability as tfp
  tfd = tfp.distributions
  
  # Define a single scalar DoublesidedMaxwell distribution.
  dist = tfd.DoublesidedMaxwell(loc=0., scale=3.)
  
  # Evaluate the cdf at 1, returning a scalar.
  dist.cdf(1.)
  
  # Define a batch of two scalar valued DoublesidedMaxwells.
  # The first has mean 1 and standard deviation 11, the second 2 and 22.
  dist = tfd.DoublesidedMaxwell(loc=[1, 2.], scale=[11, 22.])
  
  # Evaluate the pdf of the first distribution on 0, and the second on 1.5,
  # returning a length two tensor.
  dist.prob([0, 1.5])
  
  # Get 3 samples, returning a 3 x 2 tensor.
  dist.sample([3])
  ```
  
  #### References
   [1]: Mohamed, et all, "Monte Carlo Gradient Estimation in Machine Learning.",
      2019 https://arxiv.org/abs/1906.10652
   [2] B. Heidergott, et all "Sensitivity estimation for Gaussian
      systems", 2008.  European Journal of Operational Research,
      vol. 187, pp193-207.
   [3] G. Pflug. "Optimization of Stochastic Models: The Interface Between
    Simulation and Optimization", 2002. Chp. 4.2, pg 247.
class_docstr_tok: ["Double-sided","Maxwell","distribution",".","This","distribution","is","useful","to","compute","measure","valued","derivatives","for","Gaussian","distributions",".","See","[","Mohamed","et","al",".","2019","]","[","1","]","for","more","details",".","#","#","#","#","Mathematical","details","The","double-sided","Maxwell","distribution","generalizes","the","Maxwell","distribution","to","the","entire","real","line",".","``","`","none","pdf","(","x",";","mu",",","sigma",")","=","1\/","(","sigma","*","sqrt","(","2","*","pi",")",")","*","(","(","x-mu",")","\/sigma",")","^2","*","exp","(","-0.5","(","(","x-mu",")","\/sigma",")","^2",")","``","`","where","`","loc","=","mu","`","and","`","scale","=","sigma","`",".","The","DoublesidedMaxwell","distribution","is","a","member","of","the","[","location-scale","family","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Location-scale_family",")",",","i.e.",",","it","can","be","constructed","as",",","``","`","none","X","~","DoublesidedMaxwell","(","loc=0",",","scale=1",")","Y","=","loc","+","scale","*","X","``","`","The","double-sided","Maxwell","is","a","symmetric","distribution","that","extends","the","one-sided","maxwell","from","R+","to","the","entire","real","line",".","Their","densities","are","therefore","the","same","up","to","a","factor","of","0.5",".","It","has","several","methods","for","generating","random","variates","from","it",".","The","version","here","uses","3","Gaussian","variates","and","a","uniform","variate","to","generate","the","samples","The","sampling","path","is",":","mu","+","sigma","*","sgn","(","U-0.5",")","*","sqrt","(","X^2","+","Y^2","+","Z^2",")","U~Unif",";","X",",","Y",",","Z","~N","(","0,1",")","In","the","sampling","process","above",",","the","random","variates","generated","by","sqrt","(","X^2","+","Y^2","+","Z^2",")","are","samples","from","the","one-sided","Maxwell","(","or","Maxwell-Boltzmann",")","distribution",".","#","#","#","#","Examples","``","`","python","import","tensorflow_probability","as","tfp","tfd","=","tfp.distributions","#","Define","a","single","scalar","DoublesidedMaxwell","distribution",".","dist","=","tfd.DoublesidedMaxwell","(","loc=0.",",","scale=3",".",")","#","Evaluate","the","cdf","at","1",",","returning","a","scalar",".","dist.cdf","(","1",".",")","#","Define","a","batch","of","two","scalar","valued","DoublesidedMaxwells",".","#","The","first","has","mean","1","and","standard","deviation","11",",","the","second","2","and","22.","dist","=","tfd.DoublesidedMaxwell","(","loc=","[","1",",","2",".","]",",","scale=","[","11",",","22",".","]",")","#","Evaluate","the","pdf","of","the","first","distribution","on","0",",","and","the","second","on","1.5",",","#","returning","a","length","two","tensor",".","dist.prob","(","[","0",",","1.5","]",")","#","Get","3","samples",",","returning","a","3","x","2","tensor",".","dist.sample","(","[","3","]",")","``","`","#","#","#","#","References","[","1","]",":","Mohamed",",","et","all",",","``","Monte","Carlo","Gradient","Estimation","in","Machine","Learning",".","``",",","2019","https",":","\/\/arxiv.org\/abs\/1906.10652","[","2","]","B.","Heidergott",",","et","all","``","Sensitivity","estimation","for","Gaussian","systems","''",",","2008",".","European","Journal","of","Operational","Research",",","vol",".","187",",","pp193-207",".","[","3","]","G.","Pflug",".","``","Optimization","of","Stochastic","Models",":","The","Interface","Between","Simulation","and","Optimization","''",",","2002",".","Chp",".","4.2",",","pg","247","."]
docstr: Distribution parameter for the mean.
docstr_tok: ["Distribution","parameter","for","the","mean","."]
code: def loc(self):
      """Distribution parameter for the mean."""
      return self._loc
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python import random
  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.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 3 for calling the DoublesidedMaxwell obj's underlying member method code with example usage: obj.loc() and returns: self