Exponential
- class paddle.distribution. Exponential ( rate: float | Tensor ) [source]
- 
         Exponential distribution parameterized by rate.The probability density function (pdf) is \[f(x; \theta) = \theta e^{- \theta x }, (x \ge 0) $$\]In the above equation: - \(rate = \theta\): is the rate parameter. 
 - Parameters
- 
           rate (float|Tensor) – Rate parameter. The value of rate must be positive. 
 Example >>> import paddle >>> expon = paddle.distribution.Exponential(paddle.to_tensor([0.5])) >>> print(expon.mean) Tensor(shape=[1], dtype=float32, place=Place(gpu:0), stop_gradient=True, [2.]) >>> print(expon.variance) Tensor(shape=[1], dtype=float32, place=Place(gpu:0), stop_gradient=True, [4.]) >>> print(expon.entropy()) Tensor(shape=[1], dtype=float32, place=Place(gpu:0), stop_gradient=True, [1.69314718]) - property mean : Tensor
- 
           Mean of exponential distribution. - Returns
- 
             mean value. 
- Return type
- 
             Tensor 
 
 - property variance : Tensor
- 
           Variance of exponential distribution. - Returns
- 
             variance value. 
- Return type
- 
             Tensor 
 
 - 
            
           sample
           (
           shape: Sequence[int] = []
           ) 
            Tensor
           sample¶
- 
           Generate samples of the specified shape. - Parameters
- 
             shape (Sequence[int], optional) – Shape of the generated samples. 
- Returns
- 
             Tensor, A tensor with prepended dimensions shape. The data type is float32. 
 
 - 
            
           rsample
           (
           shape: Sequence[int] = []
           ) 
            Tensor
           rsample¶
- 
           Generate reparameterized samples of the specified shape. - Parameters
- 
             shape (Sequence[int], optional) – Shape of the generated samples. 
- Returns
- 
             A tensor with prepended dimensions shape. The data type is float32. 
- Return type
- 
             Tensor 
 
 - 
            
           prob
           (
           value: float | Tensor
           ) 
            Tensor
           prob¶
- 
           Probability density function evaluated at value. \[{ f(x; \theta) = \theta e^{- \theta x}, (x \ge 0 ) }\]- Parameters
- 
             value (float|Tensor) – Value to be evaluated. 
- Returns
- 
             Probability. 
- Return type
- 
             Tensor 
 
 - 
            
           log_prob
           (
           value: float | Tensor
           ) 
            Tensor
           log_prob¶
- 
           Log probability density function evaluated at value. - Parameters
- 
             value (float|Tensor) – Value to be evaluated 
- Returns
- 
             Log probability. 
- Return type
- 
             Tensor 
 
 - 
            
           entropy
           (
           ) 
            Tensor
           entropy¶
- 
           Entropy of exponential distribution. - Returns
- 
             Entropy. 
- Return type
- 
             Tensor 
 
 - 
            
           cdf
           (
           value: float | Tensor
           ) 
            Tensor
           cdf¶
- 
           Cumulative distribution function(CDF) evaluated at value. \[{ cdf(x; \theta) = 1 - e^{- \theta x }, (x \ge 0) }\]- Parameters
- 
             value (float|Tensor) – Value to be evaluated. 
- Returns
- 
             CDF evaluated at value. 
- Return type
- 
             Tensor 
 
 - property batch_shape : Sequence[int]
- 
           Returns batch shape of distribution - Returns
- 
             batch shape 
- Return type
- 
             Sequence[int] 
 
 - property event_shape : Sequence[int]
- 
           Returns event shape of distribution - Returns
- 
             event shape 
- Return type
- 
             Sequence[int] 
 
 - 
            
           icdf
           (
           value: float | Tensor
           ) 
            Tensor
           icdf¶
- 
           Inverse cumulative distribution function(CDF) evaluated at value. \[{ icdf(x; \theta) = -\frac{ 1 }{ \theta } ln(1 + x), (x \ge 0) }\]- Parameters
- 
             value (float|Tensor) – Value to be evaluated. 
- Returns
- 
             CDF evaluated at value. 
- Return type
- 
             Tensor 
 
 - 
            
           probs
           (
           value: Tensor
           ) 
            Tensor
           probs¶
- 
           Probability density/mass function. Note This method will be deprecated in the future, please use prob instead. 
 
