本文整理汇总了C#中PositiveDefiniteMatrix.Inner方法的典型用法代码示例。如果您正苦于以下问题:C# PositiveDefiniteMatrix.Inner方法的具体用法?C# PositiveDefiniteMatrix.Inner怎么用?C# PositiveDefiniteMatrix.Inner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PositiveDefiniteMatrix
的用法示例。
在下文中一共展示了PositiveDefiniteMatrix.Inner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InnerProductAverageLogarithm
/// <summary>
/// VMP message to 'innerProduct'
/// </summary>
/// <param name="AMean">Buffer 'AMean'.</param>
/// <param name="AVariance">Buffer 'AVariance'.</param>
/// <param name="BMean">Buffer 'BMean'.</param>
/// <param name="BVariance">Buffer 'BVariance'.</param>
/// <returns>The outgoing VMP message to the 'innerProduct' argument</returns>
/// <remarks><para>
/// The outgoing message is the factor viewed as a function of 'innerProduct' conditioned on the given values.
/// </para></remarks>
public static Gaussian InnerProductAverageLogarithm(Vector AMean, PositiveDefiniteMatrix AVariance, Vector BMean, PositiveDefiniteMatrix BVariance)
{
Gaussian result = new Gaussian();
// p(x|a,b) = N(E[a]'*E[b], E[b]'*var(a)*E[b] + E[a]'*var(b)*E[a] + trace(var(a)*var(b)))
// Uses John Winn's rule for deterministic factors.
// Strict variational inference would set the variance to 0.
result.SetMeanAndVariance(AMean.Inner(BMean), AVariance.QuadraticForm(BMean) + BVariance.QuadraticForm(AMean) + AVariance.Inner(BVariance));
return result;
}