Class CasesBoolOp
Provides outgoing messages for CasesBool(Boolean, out Boolean, out Boolean), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Gate), "CasesBool", new Type[]{typeof(bool), typeof(bool), typeof(bool)})]
[Quality(QualityBand.Experimental)]
public static class CasesBoolOp
Methods
AverageLogFactor(Bernoulli, Bernoulli, Bernoulli)
Evidence message for VMP.
Declaration
[SkipIfAllUniform(new string[]{"case0", "case1"})]
public static double AverageLogFactor(Bernoulli case0, Bernoulli case1, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | case0 | Incoming message from |
Bernoulli | case1 | Incoming message from |
Bernoulli | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
BAverageConditional(Bernoulli, Bernoulli)
EP message to b
.
Declaration
[SkipIfAllUniform]
public static Bernoulli BAverageConditional(Bernoulli case0, Bernoulli case1)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | case0 | Incoming message from |
Bernoulli | case1 | 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_(case0,case1) p(case0,case1) factor(b,case0,case1)]/p(b)
.
BAverageLogarithm(Bernoulli, Bernoulli)
VMP message to b
.
Declaration
[SkipIfAllUniform]
public static Bernoulli BAverageLogarithm(Bernoulli case0, Bernoulli case1)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | case0 | Incoming message from |
Bernoulli | case1 | 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_(case0,case1) p(case0,case1) log(factor(b,case0,case1)))
.
Case0AverageConditional(Bernoulli)
EP message to case0
.
Declaration
public static Bernoulli Case0AverageConditional(Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
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 case0
as the random arguments are varied. The formula is proj[p(case0) sum_(b) p(b) factor(b,case0,case1)]/p(case0)
.
Case0AverageLogarithm(Bernoulli)
VMP message to case0
.
Declaration
public static Bernoulli Case0AverageLogarithm(Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
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 case0
. The formula is exp(sum_(b) p(b) log(factor(b,case0,case1)))
.
Case1AverageConditional(Bernoulli)
EP message to case1
.
Declaration
public static Bernoulli Case1AverageConditional(Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
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 case1
as the random arguments are varied. The formula is proj[p(case1) sum_(b) p(b) factor(b,case0,case1)]/p(case1)
.
Case1AverageLogarithm(Bernoulli)
VMP message to case1
.
Declaration
public static Bernoulli Case1AverageLogarithm(Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
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 case1
. The formula is exp(sum_(b) p(b) log(factor(b,case0,case1)))
.
LogEvidenceRatio(Bernoulli, Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli case0, Bernoulli case1, Bernoulli b)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | case0 | Incoming message from |
Bernoulli | case1 | 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_(case0,case1,b) p(case0,case1,b) factor(b,case0,case1))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.