Class DiscreteEnumFromDirichletOp<TEnum>
Provides outgoing messages for DiscreteEnum<TEnum>(Vector), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(EnumSupport), "DiscreteEnum<>", new Type[]{})]
[Quality(QualityBand.Stable)]
public static class DiscreteEnumFromDirichletOp<TEnum>
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enumeration. |
Remarks
This class provides operators which have Enum arguments.
The rest are provided by DiscreteFromDirichletOp.
Methods
AverageLogFactor(TEnum, Dirichlet)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(TEnum sample, Dirichlet probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Dirichlet | probs | Incoming message from |
Returns
Type | Description |
---|---|
Double | Average of the factor's log-value across the given argument distributions. |
Remarks
The formula for the result is sum_(Sample,Probs) p(Sample,Probs) log(factor(Sample,Probs))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(TEnum, Vector)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(TEnum sample, Vector probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Vector | probs | Constant value for |
Returns
Type | Description |
---|---|
Double | Average of the factor's log-value across the given argument distributions. |
Remarks
The formula for the result is sum_(Sample) p(Sample) log(factor(Sample,Probs))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(TEnum, Dirichlet)
Evidence message for EP.
Declaration
public static double LogAverageFactor(TEnum sample, Dirichlet probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Dirichlet | probs | 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_(Sample,Probs) p(Sample,Probs) factor(Sample,Probs))
.
LogAverageFactor(TEnum, Vector)
Evidence message for EP.
Declaration
public static double LogAverageFactor(TEnum sample, Vector probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Vector | probs | 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_(Sample) p(Sample) factor(Sample,Probs))
.
LogEvidenceRatio(TEnum, Dirichlet)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(TEnum sample, Dirichlet probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Dirichlet | probs | 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_(Sample,Probs) p(Sample,Probs) factor(Sample,Probs) / sum_Sample p(Sample) messageTo(Sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(TEnum, Vector)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(TEnum sample, Vector probs)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Vector | probs | 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_(Sample) p(Sample) factor(Sample,Probs) / sum_Sample p(Sample) messageTo(Sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
ProbsAverageConditional(TEnum, Dirichlet)
EP message to Probs
.
Declaration
public static Dirichlet ProbsAverageConditional(TEnum sample, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is a distribution matching the moments of Probs
as the random arguments are varied. The formula is proj[p(Probs) sum_(Sample) p(Sample) factor(Sample,Probs)]/p(Probs)
.
ProbsAverageLogarithm(TEnum, Dirichlet)
VMP message to Probs
.
Declaration
public static Dirichlet ProbsAverageLogarithm(TEnum sample, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
TEnum | sample | Incoming message from |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except Probs
. The formula is exp(sum_(Sample) p(Sample) log(factor(Sample,Probs)))
.