shrinath-suresh/blogs-docs-splitted huggingface dataset:
likewise be normalized so that the resulting probabilities sum to
     1 along the last dimension. "logits" will return this normalized
     value.
See also: "torch.distributions.Categorical()" for specifications of
   "probs" and "logits".
Example:
  >>> m = OneHotCategorical(torch.tensor([ 0.25, 0.25, 0.25, 0.25 ]))
  >>> m.sample()  # equal probability of 0, 1, 2, 3
  tensor([ 0.,  0.,  0.,  1.])

Parameters:
      * probs (Tensor) -- event probabilities
  * **logits** (*Tensor*) -- event log probabilities
    (unnormalized)

arg_constraints = {'logits': IndependentConstraint(Real(), 1), 'probs': Simplex()}
entropy()
enumerate_support(expand=True)
expand(batch_shape, _instance=None)
has_enumerate_support = True
log_prob(value)
property logits
property mean
property mode
property param_shape
property probs
sample(sample_shape=torch.Size([]))
support = OneHot()
property variance
Pareto
property variance
Pareto
class torch.distributions.pareto.Pareto(scale, alpha, validate_args=None)
Bases: "TransformedDistribution"
Samples from a Pareto Type 1 distribution.
Example:
  >>> m = Pareto(torch.tensor([1.0]), torch.tensor([1.0]))
  >>> m.sample()  # sample from a Pareto distribution with scale=1 and alpha=1
  tensor([ 1.5623])

Parameters:
      * scale (float or Tensor) -- Scale parameter of the
        distribution
  * **alpha** (*float** or **Tensor*) -- Shape parameter of the
    distribution

arg_constraints: Dict[str, constraints.Constraint] = {'alpha': GreaterThan(lower_bound=0.0), 'scale': GreaterThan(lower_bound=0.0)}
entropy()
expand(batch_shape, _instance=None)
property mean
property mode
property support
property variance
Poisson
class torch.distributions.poisson.Poisson(rate, validate_args=None)
Bases: "ExponentialFamily"
Bases: "ExponentialFamily"
Creates a Poisson distribution parameterized by "rate", the rate
   parameter.
Samples are nonnegative integers, with a pmf given by
  \mathrm{rate}^k \frac{e^{-\mathrm{rate}}}{k!}

Example:
  >>> m = Poisson(torch.tensor([4]))
  >>> m.sample()
  tensor([ 3.])

Parameters:
      rate (Number, Tensor) -- the rate parameter
arg_constraints = {'rate': GreaterThanEq(lower_bound=0.0)}
expand(batch_shape, _instance=None)
log_prob(value)
property mean
property mode
sample(sample_shape=torch.Size([]))
support = IntegerGreaterThan(lower_bound=0)
property variance
RelaxedBernoulli
class torch.distributions.relaxed_bernoulli.RelaxedBernoulli(temperature, probs=None, logits=None, validate_args=None)
Bases: "TransformedDistribution"
Creates a RelaxedBernoulli distribution, parametrized by
   "temperature", and either "probs" or "logits" (but not both). This
is a relaxed version of the Bernoulli distribution, so the values
   are in (0, 1), and has reparametrizable samples.
Example:
  >>> m = RelaxedBernoulli(torch.tensor([2.2]),
  ...                      torch.tensor([0.1, 0.2, 0.3, 0.99]))
  >>> m.sample()
  tensor([ 0.2951,  0.3442,  0.8918,  0.9021])

Parameters:
      * temperature (Tensor) -- relaxation temperature
  * **probs** (*Number**, **Tensor*) -- the probability of
    sampling *1*

  * **logits** (*Number**, **Tensor*) -- the log-odds of sampling
    *1*

arg_constraints: Dict[str, constraints.Constraint] = {'logits': Real(), 'probs': Interval(lower_bound=0.0, upper_bound=1.0)}
expand(batch_shape, _instance=None)
has_rsample = True
property logits
property probs
support = Interval(lower_bound=0.0, upper_bound=1.0)
property temperature
LogitRelaxedBernoulli
LogitRelaxedBernoulli
class torch.distributions.relaxed_bernoulli.LogitRelaxedBernoulli(temperature, probs=None, logits=None, validate_args=None)
Bases: "Distribution"
Creates a LogitRelaxedBernoulli distribution parameterized by
   "probs" or "logits" (but not both), which is the logit of a
   RelaxedBernoulli distribution.
Samples are logits of values in (0, 1). See [1] for more details.
Parameters:
      * temperature (Tensor) -- relaxation temperature
  * **probs** (*Number**, **Tensor*) -- the probability of
    sampling *1*

  * **logits** (*Number**, **Tensor*) -- the log-odds of sampling
    *1*

[1] The Concrete Distribution: A Continuous Relaxation of Discrete
   Random Variables (Maddison et al, 2017)
[2] Categorical Reparametrization with Gumbel-Softmax (Jang et al,
   2017)
arg_constraints = {'logits': Real(), 'probs': Interval(lower_bound=0.0, upper_bound=1.0)}
expand(batch_shape, _instance=None)
log_prob(value)
log_prob(value)
property logits
property param_shape
property probs
rsample(sample_shape=torch.Size([]))
support = Real()
RelaxedOneHotCategorical
class torch.distributions.relaxed_categorical.RelaxedOneHotCategorical(temperature, probs=None, logits=None, validate_args=None)
Bases: "TransformedDistribution"
Creates a RelaxedOneHotCategorical distribution parametrized by
   "temperature", and either "probs" or "logits". This is a relaxed
   version of the "OneHotCategorical" distribution, so its samples are
   on simplex, and are reparametrizable.
Example:
  >>> m = RelaxedOneHotCategorical(torch.tensor([2.2]),
  ...                              torch.tensor([0.1, 0.2, 0.3, 0.4]))
  >>> m.sample()
  tensor([ 0.1294,  0.2324,  0.3859,  0.2523])

Parameters:
      * temperature (Tensor) -- relaxation temperature
  * **probs** (*Tensor*) -- event probabilities
logits (Tensor) -- unnormalized log probability for each
        event

arg_constraints: Dict[str, constraints.Constraint] = {'logits': IndependentConstraint(Real(), 1), 'probs': Simplex()}
expand(batch_shape, _instance=None)
has_rsample = True
property logits
property probs
support = Simplex()
property temperature
StudentT
class torch.distributions.studentT.StudentT(df, loc=0.0, scale=1.0, validate_args=None)
Bases: "Distribution"
Creates a Student's t-distribution parameterized by degree of
   freedom "df", mean "loc" and scale "scale".
Example:
  >>> m = StudentT(torch.tensor([2.0]))
  >>> m.sample()  # Student's t-distributed with degrees of freedom=2
  tensor([ 0.1046])

Parameters:
      * df (float or Tensor) -- degrees of freedom
  * **loc** (*float** or **Tensor*) -- mean of the distribution

  * **scale** (*float** or **Tensor*) -- scale of the distribution
arg_constraints = {'df': GreaterThan(lower_bound=0.0), 'loc': Real(), 'scale': GreaterThan(lower_bound=0.0)}
entropy()
expand(batch_shape, _instance=None)
has_rsample = True
log_prob(value)
property mean
property mode
rsample(sample_shape=torch.Size([]))
support = Real()
property variance
TransformedDistribution
class torch.distributions.transformed_distribution.TransformedDistribution(base_distribution, transforms, validate_args=None)
Bases: "Distribution"
Extension of the Distribution class, which applies a sequence of
   Transforms to a base distribution.  Let f be the composition of
   transforms applied:
  X ~ BaseDistribution
  Y = f(X) ~ TransformedDistribution(BaseDistribution, f)
  log p(Y) = log p(X) + log |det (dX/dY)|

Note that the ".event_shape" of a "TransformedDistribution" is the
   maximum shape of its base distribution and its transforms, since
   transforms can introduce correlations among events.
An example for the usage of "TransformedDistribution" would be:
  # Building a Logistic Distribution
  # X ~ Uniform(0, 1)
  # f = a + b * logit(X)
  # Y ~ f(X) ~ Logistic(a, b)
  base_distribution = Uniform(0, 1)
  transforms = [SigmoidTransform().inv, AffineTransform(loc=a, scale=b)]
  logistic = TransformedDistribution(base_distribution, transforms)

For more examples, please look at the implementations of "Gumbel",
   "HalfCauchy", "HalfNormal", "LogNormal", "Pareto", "Weibull",
   "RelaxedBernoulli" and "RelaxedOneHotCategorical"
arg_constraints: Dict[str, Constraint] = {}
cdf(value)
  Computes the cumulative distribution function by inverting the
  transform(s) and computing the score of the base distribution.

expand(batch_shape, _instance=None)
property has_rsample
icdf(value)
  Computes the inverse cumulative distribution function using
  transform(s) and computing the score of the base distribution.

log_prob(value)
log_prob(value)
  Scores the sample by inverting the transform(s) and computing
  the score using the score of the base distribution and the log
  abs det jacobian.

rsample(sample_shape=torch.Size([]))
  Generates a sample_shape shaped reparameterized sample or
  sample_shape shaped batch of reparameterized samples if the
  distribution parameters are batched. Samples first from base
  distribution and applies *transform()* for every transform in
  the list.

sample(sample_shape=torch.Size([]))
  Generates a sample_shape shaped sample or sample_shape shaped
  batch of samples if the distribution parameters are batched.
  Samples first from base distribution and applies *transform()*
  for every transform in the list.

property support
Uniform
class torch.distributions.uniform.Uniform(low, high, validate_args=None)
Bases: "Distribution"
Generates uniformly distributed random samples from the half-open
   interval "[low, high)".
interval "[low, high)".
Example:
  >>> m = Uniform(torch.tensor([0.0]), torch.tensor([5.0]))
  >>> m.sample()  # uniformly distributed in the range [0.0, 5.0)
  tensor([ 2.3418])

Parameters:
      * low (float or Tensor) -- lower range (inclusive).
  * **high** (*float** or **Tensor*) -- upper range (exclusive).

arg_constraints = {'high': Dependent(), 'low': Dependent()}
cdf(value)
entropy()
expand(batch_shape, _instance=None)
has_rsample = True
icdf(value)
log_prob(value)
property mean
property mode
rsample(sample_shape=torch.Size([]))
property stddev
property support
property variance
VonMises
class torch.distributions.von_mises.VonMises(loc, concentration, validate_args=None)
Bases: "Distribution"
A circular von Mises distribution.
This implementation uses polar coordinates. The "loc" and "value"
   args can be any real number (to facilitate unconstrained
optimization), but are interpreted as angles modulo 2 pi.
Example::
      >>> m = VonMises(torch.tensor([1.0]), torch.tensor([1.0]))
      >>> m.sample()  # von Mises distributed with loc=1 and concentration=1
      tensor([1.9777])
Parameters:
      * loc (torch.Tensor) -- an angle in radians.
  * **concentration** (*torch.Tensor*) -- concentration parameter

arg_constraints = {'concentration': GreaterThan(lower_bound=0.0), 'loc': Real()}
expand(batch_shape)
has_rsample = False
log_prob(value)
property mean
  The provided mean is the circular one.

property mode
sample(sample_shape=torch.Size([]))
  The sampling algorithm for the von Mises distribution is based
  on the following paper: Best, D. J., and Nicholas I. Fisher.
  "Efficient simulation of the von Mises distribution." Applied
  Statistics (1979): 152-157.

support = Real()
property variance
  The provided variance is the circular one.

Weibull
Weibull
class torch.distributions.weibull.Weibull(scale, concentration, validate_args=None)
Bases: "TransformedDistribution"
Samples from a two-parameter Weibull distribution.
-[ Example ]-



m = Weibull(torch.tensor([1.0]), torch.tensor([1.0]))
m.sample()  # sample from a Weibull distribution with scale=1, concentration=1
   tensor([ 0.4784])



Parameters:
      * scale (float or Tensor) -- Scale parameter of
        distribution (lambda).
  * **concentration** (*float** or **Tensor*) -- Concentration
    parameter of distribution (k/shape).

arg_constraints: Dict[str, constraints.Constraint] = {'concentration': GreaterThan(lower_bound=0.0), 'scale': GreaterThan(lower_bound=0.0)}
entropy()
expand(batch_shape, _instance=None)
property mean
property mode
support = GreaterThan(lower_bound=0.0)
property variance
Wishart
property variance
Wishart
class torch.distributions.wishart.Wishart(df, covariance_matrix=None, precision_matrix=None, scale_tril=None, validate_args=None)
Bases: "ExponentialFamily"
Creates a Wishart distribution parameterized by a symmetric
   positive definite matrix \Sigma, or its Cholesky decomposition
   \mathbf{\Sigma} = \mathbf{L}\mathbf{L}^\top
-[ Example ]-



m = Wishart(torch.eye(2), torch.Tensor([2]))
m.sample()  # Wishart distributed with mean=df * I and
            # variance(x_ij)=df for i != j and variance(x_ij)=2 * df for i == j



Parameters:
      * covariance_matrix (Tensor) -- positive-definite
        covariance matrix
  * **precision_matrix** (*Tensor*) -- positive-definite precision
    matrix

  * **scale_tril** (*Tensor*) -- lower-triangular factor of
    covariance, with positive-valued diagonal

  * **df** (*float** or **Tensor*) -- real-valued parameter larger
than the (dimension of Square matrix) - 1
Note:
 Only one of "covariance_matrix" or "precision_matrix" or
 "scale_tril" can be specified. Using "scale_tril" will be more
 efficient: all computations internally are based on "scale_tril".
 If "covariance_matrix" or "precision_matrix" is passed instead,
 it is only used to compute the corresponding lower triangular
 matrices using a Cholesky decomposition.
 'torch.distributions.LKJCholesky' is a restricted Wishart
 distribution.[1]

References
[1] Wang, Z., Wu, Y. and Chu, H., 2018. On equivalence of the LKJ
   distribution and the restricted Wishart distribution. [2] Sawyer,
   S., 2007. Wishart Distributions and Inverse-Wishart Sampling. [3]
   Anderson, T. W., 2003. An Introduction to Multivariate Statistical
   Analysis (3rd ed.). [4] Odell, P. L. & Feiveson, A. H., 1966. A
   Numerical Procedure to Generate a SampleCovariance Matrix. JASA,
61(313):199-203. [5] Ku, Y.-C. & Bloomfield, P., 2010. Generating
   Random Wishart Matrices with Fractional Degrees of Freedom in OX.
arg_constraints = {'covariance_matrix': PositiveDefinite(), 'df': GreaterThan(lower_bound=0), 'precision_matrix': PositiveDefinite(), 'scale_tril': LowerCholesky()}
property covariance_matrix
entropy()
expand(batch_shape, _instance=None)
has_rsample = True
log_prob(value)
property mean
property mode
property precision_matrix
rsample(sample_shape=torch.Size([]), max_try_correction=None)
  Warning:

    In some cases, sampling algorithm based on Bartlett
    decomposition may return singular matrix samples. Several
    tries to correct singular samples are performed by default,
    but it may end up returning singular matrix samples. Singular
    samples may return *-inf* values in *.log_prob()*. In those
    cases, the user should validate the samples and either fix the
value of df or adjust max_try_correction value for
        argument in .rsample accordingly.
property scale_tril
support = PositiveDefinite()
property variance
KL Divergence
torch.distributions.kl.kl_divergence(p, q)
Compute Kullback-Leibler divergence KL(p | q) between two
   distributions.
  KL(p \| q) = \int p(x) \log\frac {p(x)} {q(x)} \,dx

Parameters:
      * p (Distribution) -- A "Distribution" object.
  * **q** (*Distribution*) -- A "Distribution" object.

Returns:
      A batch of KL divergences of shape batch_shape.
Return type:
      Tensor
Raises:
      NotImplementedError -- If the distribution types have not
      been registered via     "register_kl()".
KL divergence is currently implemented for the following
   distribution pairs:
      * "Bernoulli" and "Bernoulli"
  * "Bernoulli" and "Poisson"

  * "Beta" and "Beta"

  * "Beta" and "ContinuousBernoulli"

  * "Beta" and "Exponential"
"Beta" and "Exponential"


"Beta" and "Gamma"


"Beta" and "Normal"


"Beta" and "Pareto"


"Beta" and "Uniform"


"Binomial" and "Binomial"


"Categorical" and "Categorical"


"Cauchy" and "Cauchy"


"ContinuousBernoulli" and "ContinuousBernoulli"


"ContinuousBernoulli" and "Exponential"


"ContinuousBernoulli" and "Normal"


"ContinuousBernoulli" and "Pareto"


"ContinuousBernoulli" and "Uniform"


"Dirichlet" and "Dirichlet"


"Exponential" and "Beta"


"Exponential" and "ContinuousBernoulli"


"Exponential" and "Exponential"


"Exponential" and "Gamma"


"Exponential" and "Gumbel"


"Exponential" and "Normal"


"Exponential" and "Pareto"


"Exponential" and "Uniform"


"ExponentialFamily" and "ExponentialFamily"


"Gamma" and "Beta"


"Gamma" and "ContinuousBernoulli"


"Gamma" and "Exponential"


"Gamma" and "Gamma"
"Gamma" and "Gamma"


"Gamma" and "Gumbel"


"Gamma" and "Normal"


"Gamma" and "Pareto"


"Gamma" and "Uniform"


"Geometric" and "Geometric"


"Gumbel" and "Beta"


"Gumbel" and "ContinuousBernoulli"


"Gumbel" and "Exponential"


"Gumbel" and "Gamma"


"Gumbel" and "Gumbel"


"Gumbel" and "Normal"


"Gumbel" and "Pareto"


"Gumbel" and "Uniform"


"HalfNormal" and "HalfNormal"


"Independent" and "Independent"


"Laplace" and "Beta"


"Laplace" and "ContinuousBernoulli"


"Laplace" and "Exponential"


"Laplace" and "Gamma"


"Laplace" and "Laplace"


"Laplace" and "Normal"


"Laplace" and "Pareto"


"Laplace" and "Uniform"


"LowRankMultivariateNormal" and "LowRankMultivariateNormal"


"LowRankMultivariateNormal" and "MultivariateNormal"


"MultivariateNormal" and "LowRankMultivariateNormal"
"MultivariateNormal" and "MultivariateNormal"


"Normal" and "Beta"


"Normal" and "ContinuousBernoulli"


"Normal" and "Exponential"


"Normal" and "Gamma"


"Normal" and "Gumbel"


"Normal" and "Laplace"


"Normal" and "Normal"


"Normal" and "Pareto"


"Normal" and "Uniform"


"OneHotCategorical" and "OneHotCategorical"


"Pareto" and "Beta"


"Pareto" and "ContinuousBernoulli"


"Pareto" and "Exponential"


"Pareto" and "Gamma"


"Pareto" and "Normal"


"Pareto" and "Pareto"


"Pareto" and "Uniform"


"Poisson" and "Bernoulli"


"Poisson" and "Binomial"


"Poisson" and "Poisson"


"TransformedDistribution" and "TransformedDistribution"


"Uniform" and "Beta"


"Uniform" and "ContinuousBernoulli"


"Uniform" and "Exponential"


"Uniform" and "Gamma"


"Uniform" and "Gumbel"


"Uniform" and "Normal"
"Uniform" and "Normal"


"Uniform" and "Pareto"


"Uniform" and "Uniform"




torch.distributions.kl.register_kl(type_p, type_q)
Decorator to register a pairwise function with "kl_divergence()".
   Usage:
  @register_kl(Normal, Normal)
  def kl_normal_normal(p, q):
      # insert implementation here

Lookup returns the most specific (type,type) match ordered by
   subclass. If the match is ambiguous, a RuntimeWarning is raised.
   For example to resolve the ambiguous situation:
  @register_kl(BaseP, DerivedQ)
  def kl_version1(p, q): ...
  @register_kl(DerivedP, BaseQ)
  def kl_version2(p, q): ...

you should register a third most-specific implementation, e.g.:
  register_kl(DerivedP, DerivedQ)(kl_version1)  # Break the tie.

Parameters:
      * type_p (type) -- A subclass of "Distribution".
  * **type_q** (*type*) -- A subclass of "Distribution".

Transforms
Transforms
class torch.distributions.transforms.AbsTransform(cache_size=0)
Transform via the mapping y = |x|.
class torch.distributions.transforms.AffineTransform(loc, scale, event_dim=0, cache_size=0)
Transform via the pointwise affine mapping y = \text{loc} +
   \text{scale} \times x.
Parameters:
      * loc (Tensor or float) -- Location parameter.
  * **scale** (*Tensor** or **float*) -- Scale parameter.

  * **event_dim** (*int*) -- Optional size of *event_shape*. This
    should be zero for univariate random variables, 1 for
    distributions over vectors, 2 for distributions over matrices,
    etc.

class torch.distributions.transforms.CatTransform(tseq, dim=0, lengths=None, cache_size=0)
Transform functor that applies a sequence of transforms tseq
   component-wise to each submatrix at dim, of length
   lengths[dim], in a way compatible with "torch.cat()".
Example:
Example:
  x0 = torch.cat([torch.range(1, 10), torch.range(1, 10)], dim=0)
  x = torch.cat([x0, x0], dim=0)
  t0 = CatTransform([ExpTransform(), identity_transform], dim=0, lengths=[10, 10])
  t = CatTransform([t0, t0], dim=0, lengths=[20, 20])
  y = t(x)

class torch.distributions.transforms.ComposeTransform(parts, cache_size=0)
Composes multiple transforms in a chain. The transforms being
   composed are responsible for caching.
Parameters:
      * parts (list of "Transform") -- A list of transforms to
        compose.
  * **cache_size** (*int*) -- Size of cache. If zero, no caching
    is done. If one, the latest single value is cached. Only 0 and
    1 are supported.

class torch.distributions.transforms.CorrCholeskyTransform(cache_size=0)
Transforms an uncontrained real vector x with length D*(D-1)/2 into
   the Cholesky factor of a D-dimension correlation matrix. This
   Cholesky factor is a lower triangular matrix with positive
diagonals and unit Euclidean norm for each row. The transform is
   processed as follows:
  1. First we convert x into a lower triangular matrix in row
     order.

  2. For each row X_i of the lower triangular part, we apply a
     *signed* version of class "StickBreakingTransform" to
     transform X_i into a unit Euclidean length vector using the
     following steps: - Scales into the interval (-1, 1) domain:
     r_i = \tanh(X_i). - Transforms into an unsigned domain: z_i =
     r_i^2. - Applies s_i = StickBreakingTransform(z_i). -
     Transforms back into signed domain: y_i = sign(r_i) *
     \sqrt{s_i}.

class torch.distributions.transforms.CumulativeDistributionTransform(distribution, cache_size=0)
Transform via the cumulative distribution function of a probability
   distribution.
Parameters:
      distribution (Distribution) -- Distribution whose
      cumulative distribution function to use for the transformation.
Example:
Example:
  # Construct a Gaussian copula from a multivariate normal.
  base_dist = MultivariateNormal(
      loc=torch.zeros(2),
      scale_tril=LKJCholesky(2).sample(),
  )
  transform = CumulativeDistributionTransform(Normal(0, 1))
  copula = TransformedDistribution(base_dist, [transform])

class torch.distributions.transforms.ExpTransform(cache_size=0)
Transform via the mapping y = \exp(x).
class torch.distributions.transforms.IndependentTransform(base_transform, reinterpreted_batch_ndims, cache_size=0)
Wrapper around another transform to treat
   "reinterpreted_batch_ndims"-many extra of the right most dimensions
   as dependent. This has no effect on the forward or backward
   transforms, but does sum out "reinterpreted_batch_ndims"-many of
   the rightmost dimensions in "log_abs_det_jacobian()".
Parameters:
      * base_transform ("Transform") -- A base transform.
  * **reinterpreted_batch_ndims** (*int*) -- The number of extra
rightmost dimensions to treat as dependent.
class torch.distributions.transforms.LowerCholeskyTransform(cache_size=0)
Transform from unconstrained matrices to lower-triangular matrices
   with nonnegative diagonal entries.
This is useful for parameterizing positive definite matrices in
   terms of their Cholesky factorization.
class torch.distributions.transforms.PositiveDefiniteTransform(cache_size=0)
Transform from unconstrained matrices to positive-definite
   matrices.
class torch.distributions.transforms.PowerTransform(exponent, cache_size=0)
Transform via the mapping y = x^{\text{exponent}}.
class torch.distributions.transforms.ReshapeTransform(in_shape, out_shape, cache_size=0)
Unit Jacobian transform to reshape the rightmost part of a tensor.
Note that "in_shape" and "out_shape" must have the same number of
   elements, just as for "torch.Tensor.reshape()".
Parameters:
      * in_shape (torch.Size) -- The input event shape.
out_shape (torch.Size) -- The output event shape.

class torch.distributions.transforms.SigmoidTransform(cache_size=0)
Transform via the mapping y = \frac{1}{1 + \exp(-x)} and x =
   \text{logit}(y).
class torch.distributions.transforms.SoftplusTransform(cache_size=0)
Transform via the mapping \text{Softplus}(x) = \log(1 + \exp(x)).
   The implementation reverts to the linear function when x > 20.
class torch.distributions.transforms.TanhTransform(cache_size=0)
Transform via the mapping y = \tanh(x).
It is equivalent to "ComposeTransform([AffineTransform(0., 2.),
   SigmoidTransform(), AffineTransform(-1., 2.)])" However this
   might not be numerically stable, thus it is recommended to use
   TanhTransform instead.
Note that one should use cache_size=1 when it comes to NaN/Inf
   values.
class torch.distributions.transforms.SoftmaxTransform(cache_size=0)
Transform from unconstrained space to the simplex via y = \exp(x)
   then normalizing.