Class BooleanAndOp
Provides outgoing messages for And(Boolean, Boolean), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "And", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class BooleanAndOp
Methods
AAverageConditional(Bernoulli, Bernoulli)
EP message to a
.
Declaration
public static Bernoulli AAverageConditional(Bernoulli and, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of a
as the random arguments are varied. The formula is proj[p(a) sum_(and,b) p(and,b) factor(and,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional(Bernoulli, Boolean)
EP message to a
.
Declaration
public static Bernoulli AAverageConditional(Bernoulli and, bool B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of a
as the random arguments are varied. The formula is proj[p(a) sum_(and) p(and) factor(and,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional(Boolean, Bernoulli)
EP message to a
.
Declaration
public static Bernoulli AAverageConditional(bool and, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of a
as the random arguments are varied. The formula is proj[p(a) sum_(b) p(b) factor(and,a,b)]/p(a)
.
AAverageConditional(Boolean, Boolean)
EP message to a
.
Declaration
public static Bernoulli AAverageConditional(bool and, bool B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of a
conditioned on the given values.
AAverageLogarithm(Bernoulli, Bernoulli)
VMP message to a
.
Declaration
public static Bernoulli AAverageLogarithm(Bernoulli and, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. Because the factor is deterministic, and
is integrated out before taking the logarithm. The formula is exp(sum_(b) p(b) log(sum_and p(and) factor(and,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageLogarithm(Bernoulli, Boolean)
VMP message to a
.
Declaration
public static Bernoulli AAverageLogarithm(Bernoulli and, bool B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of a
with and
integrated out. The formula is sum_and p(and) factor(and,a,b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageLogarithm(Boolean, Bernoulli)
VMP message to a
.
Declaration
[NotSupported("Variational Message Passing does not support an And factor with fixed output.")]
public static Bernoulli AAverageLogarithm(bool and, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. The formula is exp(sum_(b) p(b) log(factor(and,a,b)))
.
AAverageLogarithm(Boolean, Boolean)
VMP message to a
.
Declaration
public static Bernoulli AAverageLogarithm(bool and, bool B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of a
conditioned on the given values.
AndAverageConditional(Bernoulli, Bernoulli)
EP message to and
.
Declaration
public static Bernoulli AndAverageConditional(Bernoulli A, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | A | Incoming message from |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[p(and) sum_(a,b) p(a,b) factor(and,a,b)]/p(and)
.
AndAverageConditional(Bernoulli, Boolean)
EP message to and
.
Declaration
public static Bernoulli AndAverageConditional(Bernoulli A, bool B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | A | Incoming message from |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[p(and) sum_(a) p(a) factor(and,a,b)]/p(and)
.
AndAverageConditional(Boolean, Bernoulli)
EP message to and
.
Declaration
public static Bernoulli AndAverageConditional(bool A, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | A | Constant value for |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[p(and) sum_(b) p(b) factor(and,a,b)]/p(and)
.
AndAverageLogarithm(Bernoulli, Bernoulli)
VMP message to and
.
Declaration
public static Bernoulli AndAverageLogarithm(Bernoulli A, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | A | Incoming message from |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[sum_(a,b) p(a,b) factor(and,a,b)]
.
AndAverageLogarithm(Bernoulli, Boolean)
VMP message to and
.
Declaration
public static Bernoulli AndAverageLogarithm(Bernoulli A, bool B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | A | Incoming message from |
Boolean | B | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[sum_(a) p(a) factor(and,a,b)]
.
AndAverageLogarithm(Boolean, Bernoulli)
VMP message to and
.
Declaration
public static Bernoulli AndAverageLogarithm(bool A, Bernoulli B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | A | Constant value for |
Bernoulli | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of and
as the random arguments are varied. The formula is proj[sum_(b) p(b) factor(and,a,b)]
.
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Boolean, Boolean, Boolean)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(bool and, bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | a | Constant value for |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
BAverageConditional(Bernoulli, Bernoulli)
EP message to b
.
Declaration
public static Bernoulli BAverageConditional(Bernoulli and, Bernoulli A)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | A | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of b
as the random arguments are varied. The formula is proj[p(b) sum_(and,a) p(and,a) factor(and,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageConditional(Bernoulli, Boolean)
EP message to b
.
Declaration
public static Bernoulli BAverageConditional(Bernoulli and, bool A)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | A | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of b
as the random arguments are varied. The formula is proj[p(b) sum_(and) p(and) factor(and,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageConditional(Boolean, Bernoulli)
EP message to b
.
Declaration
public static Bernoulli BAverageConditional(bool and, Bernoulli A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | A | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of b
as the random arguments are varied. The formula is proj[p(b) sum_(a) p(a) factor(and,a,b)]/p(b)
.
BAverageConditional(Boolean, Boolean)
EP message to b
.
Declaration
public static Bernoulli BAverageConditional(bool and, bool A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | A | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
BAverageLogarithm(Bernoulli, Bernoulli)
VMP message to b
.
Declaration
public static Bernoulli BAverageLogarithm(Bernoulli and, Bernoulli A)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | A | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except b
. Because the factor is deterministic, and
is integrated out before taking the logarithm. The formula is exp(sum_(a) p(a) log(sum_and p(and) factor(and,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageLogarithm(Bernoulli, Boolean)
VMP message to b
.
Declaration
public static Bernoulli BAverageLogarithm(Bernoulli and, bool A)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | A | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of b
with and
integrated out. The formula is sum_and p(and) factor(and,a,b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageLogarithm(Boolean, Bernoulli)
VMP message to b
.
Declaration
[NotSupported("Variational Message Passing does not support an And factor with fixed output.")]
public static Bernoulli BAverageLogarithm(bool and, Bernoulli A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | A | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except b
. The formula is exp(sum_(a) p(a) log(factor(and,a,b)))
.
BAverageLogarithm(Boolean, Boolean)
VMP message to b
.
Declaration
public static Bernoulli BAverageLogarithm(bool and, bool A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | A | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
LogAverageFactor(Bernoulli, Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli and, Bernoulli a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | a | Incoming message from |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(and,a,b) p(and,a,b) factor(and,a,b))
.
LogAverageFactor(Bernoulli, Bernoulli, Boolean)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli and, Bernoulli a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Bernoulli | a | Incoming message from |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(and,a) p(and,a) factor(and,a,b))
.
LogAverageFactor(Bernoulli, Boolean, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli and, bool a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | a | Constant value for |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(and,b) p(and,b) factor(and,a,b))
.
LogAverageFactor(Bernoulli, Boolean, Boolean)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli and, bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Boolean | a | Constant value for |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(and) p(and) factor(and,a,b))
.
LogAverageFactor(Boolean, Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool and, Bernoulli a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | a | Incoming message from |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(a,b) p(a,b) factor(and,a,b))
.
LogAverageFactor(Boolean, Bernoulli, Boolean)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool and, Bernoulli a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | a | Incoming message from |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(a) p(a) factor(and,a,b))
.
LogAverageFactor(Boolean, Boolean, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool and, bool a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | a | Constant value for |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(b) p(b) factor(and,a,b))
.
LogAverageFactor(Boolean, Boolean, Boolean)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool and, bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | a | Constant value for |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(factor(and,a,b))
.
LogEvidenceRatio(Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli and)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | and | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(and) p(and) factor(and,a,b) / sum_and p(and) messageTo(and))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool and, Bernoulli a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | a | Incoming message from |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(a,b) p(a,b) factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Bernoulli, Boolean)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool and, Bernoulli a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Bernoulli | a | Incoming message from |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(a) p(a) factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Boolean, Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool and, bool a, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | a | Constant value for |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(b) p(b) factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Boolean, Boolean)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool and, bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
Boolean | and | Constant value for |
Boolean | a | Constant value for |
Boolean | b | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(factor(and,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.