当前位置: 首页>>代码示例>>C#>>正文


C# VectorGaussian.SetToProduct方法代码示例

本文整理汇总了C#中VectorGaussian.SetToProduct方法的典型用法代码示例。如果您正苦于以下问题:C# VectorGaussian.SetToProduct方法的具体用法?C# VectorGaussian.SetToProduct怎么用?C# VectorGaussian.SetToProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VectorGaussian的用法示例。


在下文中一共展示了VectorGaussian.SetToProduct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FirstAverageConditional

		/// <summary>
		/// EP message to 'first'
		/// </summary>
		/// <param name="concat">Incoming message from 'concat'. Must be a proper distribution.  If any element is uniform, the result will be uniform.</param>
		/// <param name="second">Incoming message from 'second'.</param>
		/// <param name="result">Modified to contain the outgoing message</param>
		/// <returns><paramref name="result"/></returns>
		/// <remarks><para>
		/// The outgoing message is a distribution matching the moments of 'first' as the random arguments are varied.
		/// The formula is <c>proj[p(first) sum_(concat,second) p(concat,second) factor(concat,first,second)]/p(first)</c>.
		/// </para></remarks>
		/// <exception cref="ImproperMessageException"><paramref name="concat"/> is not a proper distribution</exception>
		public static VectorGaussian FirstAverageConditional([SkipIfUniform] VectorGaussian concat, VectorGaussian second, VectorGaussian result)
		{
			if (second.IsPointMass) return FirstAverageConditional(concat, second.Point, result);
			int dim1 = result.Dimension;
			VectorGaussian concatTimesSecond = new VectorGaussian(concat.Dimension);
			concatTimesSecond.MeanTimesPrecision.SetSubvector(dim1, second.MeanTimesPrecision);
			concatTimesSecond.Precision.SetSubmatrix(dim1, dim1, second.Precision);
			concatTimesSecond.SetToProduct(concatTimesSecond, concat);
			concatTimesSecond.GetMarginal(0, result);
			return result;
		}
开发者ID:dtrckd,项目名称:Mixed-Membership-Stochastic-Blockmodel,代码行数:23,代码来源:Concat.cs

示例2: SecondAverageConditional

		/// <summary>
		/// EP message to 'second'
		/// </summary>
		/// <param name="concat">Incoming message from 'concat'. Must be a proper distribution.  If any element is uniform, the result will be uniform.</param>
		/// <param name="first">Incoming message from 'first'.</param>
		/// <param name="result">Modified to contain the outgoing message</param>
		/// <returns><paramref name="result"/></returns>
		/// <remarks><para>
		/// The outgoing message is a distribution matching the moments of 'second' as the random arguments are varied.
		/// The formula is <c>proj[p(second) sum_(concat,first) p(concat,first) factor(concat,first,second)]/p(second)</c>.
		/// </para></remarks>
		/// <exception cref="ImproperMessageException"><paramref name="concat"/> is not a proper distribution</exception>
		public static VectorGaussian SecondAverageConditional([SkipIfUniform] VectorGaussian concat, VectorGaussian first, VectorGaussian result)
		{
			if (first.IsPointMass) return SecondAverageConditional(concat, first.Point, result);
			int dim1 = first.Dimension;
			VectorGaussian concatTimesFirst = new VectorGaussian(concat.Dimension);
			concatTimesFirst.MeanTimesPrecision.SetSubvector(0, first.MeanTimesPrecision);
			concatTimesFirst.Precision.SetSubmatrix(0, 0, first.Precision);
			concatTimesFirst.SetToProduct(concatTimesFirst, concat);
			concatTimesFirst.GetMarginal(dim1, result);
			return result;
		}
开发者ID:dtrckd,项目名称:Mixed-Membership-Stochastic-Blockmodel,代码行数:23,代码来源:Concat.cs

示例3: ShapeLocationTimesFactor

 private static VectorGaussian ShapeLocationTimesFactor(
     Vector point, Gaussian shapeX, Gaussian shapeY, PositiveDefiniteMatrix shapeOrientation)
 {
     VectorGaussian shapeLocationDistr = VectorGaussian.FromMeanAndVariance(
         Vector.FromArray(shapeX.GetMean(), shapeY.GetMean()),
         new PositiveDefiniteMatrix(new double[,] { { shapeX.GetVariance(), 0.0 }, { 0.0, shapeY.GetVariance() } }));
     VectorGaussian factorDistribution = VectorGaussian.FromMeanAndPrecision(point, shapeOrientation);
     VectorGaussian result = new VectorGaussian(2);
     result.SetToProduct(shapeLocationDistr, factorDistribution);
     return result;
 }
开发者ID:hr0nix,项目名称:BayesianShapePrior,代码行数:11,代码来源:ShapeFactors.cs


注:本文中的VectorGaussian.SetToProduct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。