帶有位置 loc 和 scale 參數的拉普拉斯分布。
繼承自:Distribution
用法
tf.compat.v1.distributions.Laplace(
    loc, scale, validate_args=False, allow_nan_stats=True, name='Laplace'
)參數
- 
loc浮點張量,表征分布的位置(中心)。
- 
scale正浮點張量,表征分布的擴散。
- 
validate_argsPythonbool,默認False。盡管可能會降低運行時性能,但檢查True分發參數的有效性時。當False無效輸入可能會默默呈現不正確的輸出。
- 
allow_nan_statsPythonbool,默認True。當True時,統計信息(例如,均值、眾數、方差)使用值“NaN”來指示結果未定義。當False時,如果一個或多個統計數據的批處理成員未定義,則會引發異常。
- 
namePythonstr名稱以此類創建的 Ops 為前綴。
拋出
- 
TypeError如果loc和scale具有不同的 dtype。
屬性
- 
allow_nan_statsPythonbool說明未定義統計信息時的行為。統計數據在有意義時返回 +/- 無窮大。例如,柯西分布的方差是無窮大的。但是,有時統計數據是未定義的,例如,如果分布的 pdf 在分布的支持範圍內沒有達到最大值,則模式是未定義的。如果均值未定義,則根據定義,方差未定義。例如: df = 1 的 Student's T 的平均值是未定義的(沒有明確的方式說它是 + 或 - 無窮大),因此方差 = E[(X - mean)**2] 也是未定義的。 
- 
batch_shape來自單個事件索引的單個樣本的形狀作為TensorShape.可能部分定義或未知。 批次維度是該分布的獨立、不同參數化的索引。 
- 
dtypeTensor的DType由此Distribution處理。
- 
event_shape單個批次的單個樣品的形狀作為TensorShape.可能部分定義或未知。 
- 
loc位置的分布參數。
- 
name此Distribution創建的所有操作前的名稱。
- 
parameters用於實例化此Distribution的參數字典。
- 
reparameterization_type說明如何重新參數化分布中的樣本。目前這是靜態實例 distributions.FULLY_REPARAMETERIZED或distributions.NOT_REPARAMETERIZED之一。
- 
scale規模分布參數。
- 
validate_argsPythonbool表示啟用了可能昂貴的檢查。
數學細節
該分布的概率密度函數 (pdf) 為,
pdf(x; mu, sigma) = exp(-|x - mu| / sigma) / Z
Z = 2 sigma其中 loc = mu ,  scale = sigma 和 Z 是歸一化常數。
注意拉普拉斯分布可以認為是兩個 index 分布拚接在一起"back-to-back."
Lpalce 分布是location-scale 係列的成員,即它可以構造為,
X ~ Laplace(loc=0, scale=1)
Y = loc + scale * X相關用法
- Python tf.compat.v1.distributions.Laplace.stddev用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.cross_entropy用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.log_cdf用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.covariance用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.quantile用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.cdf用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.variance用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.kl_divergence用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.log_survival_function用法及代碼示例
- Python tf.compat.v1.distributions.Laplace.survival_function用法及代碼示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代碼示例
- Python tf.compat.v1.distributions.Bernoulli.cross_entropy用法及代碼示例
- Python tf.compat.v1.distributions.Bernoulli.covariance用法及代碼示例
- Python tf.compat.v1.distributions.Normal.log_survival_function用法及代碼示例
- Python tf.compat.v1.distributions.Multinomial.quantile用法及代碼示例
- Python tf.compat.v1.distributions.Uniform.log_survival_function用法及代碼示例
- Python tf.compat.v1.distributions.Gamma.cdf用法及代碼示例
- Python tf.compat.v1.distributions.Normal.log_cdf用法及代碼示例
- Python tf.compat.v1.distributions.Gamma.log_cdf用法及代碼示例
- Python tf.compat.v1.distributions.Dirichlet.covariance用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.distributions.Laplace。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
