本文簡要介紹python語言中 torch.distributions.lkj_cholesky.LKJCholesky 的用法。
- 用法:- class torch.distributions.lkj_cholesky.LKJCholesky(dim, concentration=1.0, validate_args=None)
- 基礎: - torch.distributions.distribution.Distribution- 相關矩陣的較低 Cholesky 因子的 LKJ 分布。分布由 - concentration參數 控製,以使從 Cholesky 因子生成的相關矩陣 的概率與 成比例。因此,當- concentration == 1時,我們在相關矩陣的 Cholesky 因子上具有均勻分布。請注意,此分布對相關矩陣的 Cholesky 因子進行采樣,而不是對相關矩陣本身進行采樣,因此與 [1] 中- LKJCorr分布的推導略有不同。對於采樣,這使用 [1] 第 3 節中的洋蔥方法。- L ~ LKJCholesky(dim, 濃度) X = L @ L' ~ LKJCorr(dim, 濃度) - 例子: - >>> l = LKJCholesky(3, 0.5) >>> l.sample() # l @ l.T is a sample of a correlation 3x3 matrix tensor([[ 1.0000, 0.0000, 0.0000], [ 0.3516, 0.9361, 0.0000], [-0.1899, 0.4748, 0.8593]])- 參考 - [1] - Generating random correlation matrices based on vines and extended onion method,丹尼爾·萊萬多夫斯基,多羅塔·庫羅威卡,哈裏·喬。
相關用法
- Python PyTorch LazyModuleMixin用法及代碼示例
- Python PyTorch LinearLR用法及代碼示例
- Python PyTorch L1Loss用法及代碼示例
- Python PyTorch LPPool2d用法及代碼示例
- Python PyTorch LeakyReLU用法及代碼示例
- Python PyTorch LogSigmoid用法及代碼示例
- Python PyTorch LowRankMixtureCrossNet用法及代碼示例
- Python PyTorch LayerNorm用法及代碼示例
- Python PyTorch LineReader用法及代碼示例
- Python PyTorch LogNormal用法及代碼示例
- Python PyTorch LambdaLR用法及代碼示例
- Python PyTorch LocalResponseNorm用法及代碼示例
- Python PyTorch LSTM用法及代碼示例
- Python PyTorch LowRankMultivariateNormal用法及代碼示例
- Python PyTorch Linear用法及代碼示例
- Python torchrec.modules.crossnet.LowRankCrossNet用法及代碼示例
- Python PyTorch LogSoftmax用法及代碼示例
- Python PyTorch LSTMCell用法及代碼示例
- Python PyTorch LocalElasticAgent用法及代碼示例
- Python PyTorch LPPool1d用法及代碼示例
- Python PyTorch Laplace用法及代碼示例
- Python PyTorch LazyModuleExtensionMixin.apply用法及代碼示例
- Python PyTorch LinearReLU用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.distributions.lkj_cholesky.LKJCholesky。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
