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