Class DiscreteEnumAreEqualOp<TEnum>
Provides outgoing messages for AreEqual<TEnum>(TEnum, TEnum), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(EnumSupport), "AreEqual<>", new Type[]{})]
[Quality(QualityBand.Stable)]
public class DiscreteEnumAreEqualOp<TEnum>
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enumeration. |
Remarks
This class only implements enumeration-specific overloads that are not provided by DiscreteAreEqualOp.
Methods
AAverageConditional(Bernoulli, TEnum, DiscreteEnum<TEnum>)
EP message to a
.
Declaration
public static DiscreteEnum<TEnum> AAverageConditional(Bernoulli areEqual, TEnum B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | Incoming message from |
TEnum | B | 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 a
as the random arguments are varied. The formula is proj[p(a) sum_(areEqual,b) p(areEqual,b) factor(areEqual,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional(Bernoulli, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static DiscreteEnum<TEnum> AAverageConditional(Bernoulli areEqual, DiscreteEnum<TEnum> B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | |
DiscreteEnum<TEnum> | B | |
DiscreteEnum<TEnum> | result |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
AAverageConditional(Boolean, TEnum, DiscreteEnum<TEnum>)
EP message to a
.
Declaration
public static DiscreteEnum<TEnum> AAverageConditional(bool areEqual, TEnum B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | B | 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 a
as the random arguments are varied. The formula is proj[p(a) sum_(b) p(b) factor(areEqual,a,b)]/p(a)
.
AAverageLogarithm(Bernoulli, TEnum, DiscreteEnum<TEnum>)
VMP message to a
.
Declaration
public static DiscreteEnum<TEnum> AAverageLogarithm(Bernoulli areEqual, TEnum B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | Incoming message from |
TEnum | B | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. Because the factor is deterministic, areEqual
is integrated out before taking the logarithm. The formula is exp(sum_(b) p(b) log(sum_areEqual p(areEqual) factor(areEqual,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageLogarithm(Bernoulli, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static DiscreteEnum<TEnum> AAverageLogarithm(Bernoulli areEqual, DiscreteEnum<TEnum> B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | |
DiscreteEnum<TEnum> | B | |
DiscreteEnum<TEnum> | result |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
AAverageLogarithm(Boolean, TEnum, DiscreteEnum<TEnum>)
VMP message to a
.
Declaration
public static DiscreteEnum<TEnum> AAverageLogarithm(bool areEqual, TEnum B, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | B | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. The formula is exp(sum_(b) p(b) log(factor(areEqual,a,b)))
.
AreEqualAverageConditional(TEnum, DiscreteEnum<TEnum>)
EP message to areEqual
.
Declaration
public static Bernoulli AreEqualAverageConditional(TEnum A, DiscreteEnum<TEnum> B)
Parameters
Type | Name | Description |
---|---|---|
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | 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 areEqual
as the random arguments are varied. The formula is proj[p(areEqual) sum_(a,b) p(a,b) factor(areEqual,a,b)]/p(areEqual)
.
AreEqualAverageConditional(DiscreteEnum<TEnum>, TEnum)
EP message to areEqual
.
Declaration
public static Bernoulli AreEqualAverageConditional(DiscreteEnum<TEnum> A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | A | Incoming message from |
TEnum | 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 areEqual
as the random arguments are varied. The formula is proj[p(areEqual) sum_(a,b) p(a,b) factor(areEqual,a,b)]/p(areEqual)
.
AreEqualAverageConditional(DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static Bernoulli AreEqualAverageConditional(DiscreteEnum<TEnum> A, DiscreteEnum<TEnum> B)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | A | |
DiscreteEnum<TEnum> | B |
Returns
Type | Description |
---|---|
Bernoulli |
AreEqualAverageLogarithm(TEnum, DiscreteEnum<TEnum>)
VMP message to areEqual
.
Declaration
public static Bernoulli AreEqualAverageLogarithm(TEnum A, DiscreteEnum<TEnum> B)
Parameters
Type | Name | Description |
---|---|---|
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of areEqual
as the random arguments are varied. The formula is proj[sum_(a,b) p(a,b) factor(areEqual,a,b)]
.
AreEqualAverageLogarithm(DiscreteEnum<TEnum>, TEnum)
VMP message to areEqual
.
Declaration
public static Bernoulli AreEqualAverageLogarithm(DiscreteEnum<TEnum> A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | A | Incoming message from |
TEnum | B | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of areEqual
as the random arguments are varied. The formula is proj[sum_(a,b) p(a,b) factor(areEqual,a,b)]
.
AreEqualAverageLogarithm(DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static Bernoulli AreEqualAverageLogarithm(DiscreteEnum<TEnum> A, DiscreteEnum<TEnum> B)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEnum<TEnum> | A | |
DiscreteEnum<TEnum> | B |
Returns
Type | Description |
---|---|
Bernoulli |
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero.
BAverageConditional(Bernoulli, TEnum, DiscreteEnum<TEnum>)
EP message to b
.
Declaration
public static DiscreteEnum<TEnum> BAverageConditional(Bernoulli areEqual, TEnum A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | Incoming message from |
TEnum | A | 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 b
as the random arguments are varied. The formula is proj[p(b) sum_(areEqual,a) p(areEqual,a) factor(areEqual,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageConditional(Bernoulli, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static DiscreteEnum<TEnum> BAverageConditional(Bernoulli areEqual, DiscreteEnum<TEnum> A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | |
DiscreteEnum<TEnum> | A | |
DiscreteEnum<TEnum> | result |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
BAverageConditional(Boolean, TEnum, DiscreteEnum<TEnum>)
EP message to b
.
Declaration
public static DiscreteEnum<TEnum> BAverageConditional(bool areEqual, TEnum A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | 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 b
as the random arguments are varied. The formula is proj[p(b) sum_(a) p(a) factor(areEqual,a,b)]/p(b)
.
BAverageLogarithm(Bernoulli, TEnum, DiscreteEnum<TEnum>)
VMP message to b
.
Declaration
public static DiscreteEnum<TEnum> BAverageLogarithm(Bernoulli areEqual, TEnum A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | Incoming message from |
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except b
. Because the factor is deterministic, areEqual
is integrated out before taking the logarithm. The formula is exp(sum_(a) p(a) log(sum_areEqual p(areEqual) factor(areEqual,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageLogarithm(Bernoulli, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static DiscreteEnum<TEnum> BAverageLogarithm(Bernoulli areEqual, DiscreteEnum<TEnum> A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | |
DiscreteEnum<TEnum> | A | |
DiscreteEnum<TEnum> | result |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
BAverageLogarithm(Boolean, TEnum, DiscreteEnum<TEnum>)
VMP message to b
.
Declaration
public static DiscreteEnum<TEnum> BAverageLogarithm(bool areEqual, TEnum A, DiscreteEnum<TEnum> result)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DiscreteEnum<TEnum> |
|
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_(a) p(a) log(factor(areEqual,a,b)))
.
LogAverageFactor(Bernoulli, TEnum, TEnum)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli areEqual, TEnum A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | Incoming message from |
TEnum | A | Incoming message from |
TEnum | B | 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_(areEqual,a,b) p(areEqual,a,b) factor(areEqual,a,b))
.
LogAverageFactor(Boolean, TEnum, TEnum)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool areEqual, TEnum A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | Incoming message from |
TEnum | B | 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_(a,b) p(a,b) factor(areEqual,a,b))
.
LogAverageFactor(Boolean, TEnum, DiscreteEnum<TEnum>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool areEqual, TEnum A, DiscreteEnum<TEnum> B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | B | 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_(a,b) p(a,b) factor(areEqual,a,b))
.
LogAverageFactor(Boolean, DiscreteEnum<TEnum>, TEnum)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool areEqual, DiscreteEnum<TEnum> A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
DiscreteEnum<TEnum> | A | Incoming message from |
TEnum | B | 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_(a,b) p(a,b) factor(areEqual,a,b))
.
LogEvidenceRatio(Bernoulli)
Declaration
public static double LogEvidenceRatio(Bernoulli areEqual)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual |
Returns
Type | Description |
---|---|
Double |
LogEvidenceRatio(Boolean, TEnum, TEnum)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool areEqual, TEnum A, TEnum B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | Incoming message from |
TEnum | 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_(a,b) p(a,b) factor(areEqual,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, TEnum, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool areEqual, TEnum A, DiscreteEnum<TEnum> B, DiscreteEnum<TEnum> to_B)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
TEnum | A | Incoming message from |
DiscreteEnum<TEnum> | B | Incoming message from |
DiscreteEnum<TEnum> | to_B | Outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(a,b) p(a,b) factor(areEqual,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, DiscreteEnum<TEnum>, TEnum, DiscreteEnum<TEnum>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool areEqual, DiscreteEnum<TEnum> A, TEnum B, DiscreteEnum<TEnum> to_A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
DiscreteEnum<TEnum> | A | Incoming message from |
TEnum | B | Incoming message from |
DiscreteEnum<TEnum> | to_A | Outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(a,b) p(a,b) factor(areEqual,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>, DiscreteEnum<TEnum>)
Declaration
public static double LogEvidenceRatio(bool areEqual, DiscreteEnum<TEnum> A, DiscreteEnum<TEnum> B, DiscreteEnum<TEnum> to_A)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | |
DiscreteEnum<TEnum> | A | |
DiscreteEnum<TEnum> | B | |
DiscreteEnum<TEnum> | to_A |
Returns
Type | Description |
---|---|
Double |