Class IntCasesOp
Provides outgoing messages for CasesInt(Int32, Int32), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(new string[]{"Cases", "i", "count"}, typeof(Gate), "CasesInt", new Type[]{typeof(int), typeof(int)})]
[Quality(QualityBand.Mature)]
public static class IntCasesOp
Methods
AverageLogFactor(IList<Bernoulli>, Discrete)
Evidence message for VMP.
Declaration
public static double AverageLogFactor([SkipIfAllUniform] IList<Bernoulli> cases, Discrete i)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
Discrete | i | 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.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
CasesAverageConditional(Discrete, Int32)
EP message to casesInt
.
Declaration
public static Bernoulli CasesAverageConditional(Discrete i, int resultIndex)
Parameters
Type | Name | Description |
---|---|---|
Discrete | i | Incoming message from |
Int32 | resultIndex | Index of the |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of casesInt
as the random arguments are varied. The formula is proj[p(casesInt) sum_(i) p(i) factor(casesInt,i,count)]/p(casesInt)
.
CasesAverageLogarithm(Discrete, Int32)
VMP message to casesInt
.
Declaration
public static Bernoulli CasesAverageLogarithm(Discrete i, int resultIndex)
Parameters
Type | Name | Description |
---|---|---|
Discrete | i | Incoming message from |
Int32 | resultIndex | Index of the |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of casesInt
as the random arguments are varied. The formula is proj[sum_(i) p(i) factor(casesInt,i,count)]
.
CasesAverageLogarithmInit(Discrete)
Declaration
public static DistributionStructArray<Bernoulli, bool> CasesAverageLogarithmInit(Discrete i)
Parameters
Type | Name | Description |
---|---|---|
Discrete | i | Incoming message from |
Returns
Type | Description |
---|---|
DistributionStructArray<Bernoulli, Boolean> |
Remarks
IAverageConditional(IList<Bernoulli>, Discrete)
EP message to i
.
Declaration
public static Discrete IAverageConditional(IList<Bernoulli> cases, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
Remarks
The outgoing message is a distribution matching the moments of i
as the random arguments are varied. The formula is proj[p(i) sum_(casesInt) p(casesInt) factor(casesInt,i,count)]/p(i)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
IAverageLogarithm(IList<Bernoulli>, Discrete)
VMP message to i
.
Declaration
public static Discrete IAverageLogarithm(IList<Bernoulli> cases, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
Remarks
The outgoing message is the factor viewed as a function of i
with casesInt
integrated out. The formula is sum_casesInt p(casesInt) factor(casesInt,i,count)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogEvidenceRatio(IList<Bernoulli>, Discrete)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(IList<Bernoulli> cases, Discrete i)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
Discrete | i | 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_(casesInt,i) p(casesInt,i) factor(casesInt,i,count) / sum_casesInt p(casesInt) messageTo(casesInt))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogEvidenceRatio(IList<Bernoulli>, Int32)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(IList<Bernoulli> cases, int i)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
Int32 | i | 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_(casesInt) p(casesInt) factor(casesInt,i,count) / sum_casesInt p(casesInt) messageTo(casesInt))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.