Exemplo n.º 1
0
 /// <summary>Evidence message for EP.</summary>
 /// <param name="or">Incoming message from <c>or</c>.</param>
 /// <param name="a">Constant value for <c>a</c>.</param>
 /// <param name="b">Constant value for <c>b</c>.</param>
 /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
 /// <remarks>
 ///   <para>The formula for the result is <c>log(sum_(or) p(or) factor(or,a,b))</c>.</para>
 /// </remarks>
 public static double LogAverageFactor(Bernoulli or, bool a, bool b)
 {
     return(or.GetLogProb(Factor.Or(a, b)));
 }
Exemplo n.º 2
0
 /// <summary>Evidence message for EP.</summary>
 /// <param name="or">Constant value for <c>or</c>.</param>
 /// <param name="a">Constant value for <c>a</c>.</param>
 /// <param name="b">Constant value for <c>b</c>.</param>
 /// <returns>Logarithm of the factor's average value across the given argument distributions.</returns>
 /// <remarks>
 ///   <para>The formula for the result is <c>log(factor(or,a,b))</c>.</para>
 /// </remarks>
 public static double LogAverageFactor(bool or, bool a, bool b)
 {
     return((or == Factor.Or(a, b)) ? 0.0 : Double.NegativeInfinity);
 }