Class EnumToIntOp<TEnum>
Provides outgoing messages for EnumToInt<TEnum>(TEnum), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(EnumSupport), "EnumToInt<>", new Type[]{})]
[Quality(QualityBand.Preview)]
public static class EnumToIntOp<TEnum>
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enumeration. |
Methods
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(Int,Enum))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Int32, TEnum)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(int Int, TEnum Enum)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
TEnum | Enum | 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.
EnumAverageConditional(Discrete, DiscreteEnum<TEnum>)
EP message to Enum
.
Declaration
public static DiscreteEnum<TEnum> EnumAverageConditional(Discrete Int, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | Int | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is a distribution matching the moments of Enum
as the random arguments are varied. The formula is proj[p(Enum) sum_(Int) p(Int) factor(Int,Enum)]/p(Enum)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
EnumAverageConditional(Int32, DiscreteEnum<TEnum>)
EP message to Enum
.
Declaration
public static DiscreteEnum<TEnum> EnumAverageConditional(int Int, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the factor viewed as a function of Enum
conditioned on the given values.
EnumAverageLogarithm(Discrete, DiscreteEnum<TEnum>)
VMP message to Enum
.
Declaration
public static DiscreteEnum<TEnum> EnumAverageLogarithm(Discrete Int, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | Int | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the factor viewed as a function of Enum
with Int
integrated out. The formula is sum_Int p(Int) factor(Int,Enum)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
EnumAverageLogarithm(Int32, DiscreteEnum<TEnum>)
VMP message to Enum
.
Declaration
public static DiscreteEnum<TEnum> EnumAverageLogarithm(int Int, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the factor viewed as a function of Enum
conditioned on the given values.
IntAverageConditional(DiscreteEnum<TEnum>, Discrete)
EP message to Int
.
Declaration
public static Discrete IntAverageConditional(DiscreteEnum<TEnum> Enum, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | Enum | 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 Int
as the random arguments are varied. The formula is proj[p(Int) sum_(Enum) p(Enum) factor(Int,Enum)]/p(Int)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
IntAverageConditionalInit(DiscreteEnum<TEnum>)
Declaration
public static Discrete IntAverageConditionalInit(DiscreteEnum<TEnum> Enum)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | Enum | Incoming message from |
Returns
Type | Description |
---|---|
Discrete |
Remarks
IntAverageLogarithm(DiscreteEnum<TEnum>, Discrete)
VMP message to Int
.
Declaration
public static Discrete IntAverageLogarithm(DiscreteEnum<TEnum> Enum, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | Enum | 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 Int
as the random arguments are varied. The formula is proj[sum_(Enum) p(Enum) factor(Int,Enum)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogAverageFactor(Discrete, TEnum)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Discrete Int, TEnum Enum)
Parameters
Type | Name | Description |
---|---|---|
Discrete | Int | Incoming message from |
TEnum | Enum | 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_(Int,Enum) p(Int,Enum) factor(Int,Enum))
.
LogAverageFactor(Discrete, DiscreteEnum<TEnum>, Discrete)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Discrete Int, DiscreteEnum<TEnum> Enum, Discrete to_Int)
Parameters
Type | Name | Description |
---|---|---|
Discrete | Int | Incoming message from |
DiscreteEnum<TEnum> | Enum | Incoming message from |
Discrete | to_Int | Outgoing message to |
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_(Int,Enum) p(Int,Enum) factor(Int,Enum))
.
LogAverageFactor(Int32, TEnum)
Evidence message for EP.
Declaration
public static double LogAverageFactor(int Int, TEnum Enum)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
TEnum | Enum | 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_(Enum) p(Enum) factor(Int,Enum))
.
LogAverageFactor(Int32, DiscreteEnum<TEnum>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(int Int, DiscreteEnum<TEnum> Enum)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
DiscreteEnum<TEnum> | Enum | 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_(Enum) p(Enum) factor(Int,Enum))
.
LogEvidenceRatio(Discrete)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Discrete Int)
Parameters
Type | Name | Description |
---|---|---|
Discrete | Int | 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_(Int) p(Int) factor(Int,Enum) / sum_Int p(Int) messageTo(Int))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Int32, TEnum)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(int Int, TEnum Enum)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
TEnum | Enum | 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_(Enum) p(Enum) factor(Int,Enum))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Int32, DiscreteEnum<TEnum>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(int Int, DiscreteEnum<TEnum> Enum)
Parameters
Type | Name | Description |
---|---|---|
Int32 | Int | Constant value for |
DiscreteEnum<TEnum> | Enum | 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_(Enum) p(Enum) factor(Int,Enum))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.