Class StringsAreEqualOp
Provides outgoing messages for AreEqual(String, String), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "AreEqual", new Type[]{typeof(string), typeof(string)})]
[Quality(QualityBand.Experimental)]
public static class StringsAreEqualOp
Methods
AreEqualAverageConditional(StringDistribution, StringDistribution)
EP message to areEqual
.
Declaration
public static Bernoulli AreEqualAverageConditional(StringDistribution str1, StringDistribution str2)
Parameters
Type | Name | Description |
---|---|---|
StringDistribution | str1 | Incoming message from |
StringDistribution | str2 | 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_(str1,str2) p(str1,str2) factor(areEqual,str1,str2)]/p(areEqual)
.
LogAverageFactor(Boolean, StringDistribution, StringDistribution)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool areEqual, StringDistribution str1, StringDistribution str2)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
StringDistribution | str1 | Incoming message from |
StringDistribution | str2 | 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_(str1,str2) p(str1,str2) factor(areEqual,str1,str2))
.
LogEvidenceRatio(Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli areEqual)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | areEqual | 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_(areEqual) p(areEqual) factor(areEqual,str1,str2) / sum_areEqual p(areEqual) messageTo(areEqual))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, StringDistribution, StringDistribution)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool areEqual, StringDistribution str1, StringDistribution str2)
Parameters
Type | Name | Description |
---|---|---|
Boolean | areEqual | Constant value for |
StringDistribution | str1 | Incoming message from |
StringDistribution | str2 | 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_(str1,str2) p(str1,str2) factor(areEqual,str1,str2))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Str1AverageConditional(StringDistribution, Bernoulli, StringDistribution)
EP message to str1
.
Declaration
public static StringDistribution Str1AverageConditional(StringDistribution str2, Bernoulli areEqual, StringDistribution result)
Parameters
Type | Name | Description |
---|---|---|
StringDistribution | str2 | Incoming message from |
Bernoulli | areEqual | Incoming message from |
StringDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
StringDistribution |
|
Remarks
The outgoing message is a distribution matching the moments of str1
as the random arguments are varied. The formula is proj[p(str1) sum_(str2,areEqual) p(str2,areEqual) factor(areEqual,str1,str2)]/p(str1)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
Str2AverageConditional(StringDistribution, Bernoulli, StringDistribution)
EP message to str2
.
Declaration
public static StringDistribution Str2AverageConditional(StringDistribution str1, Bernoulli areEqual, StringDistribution result)
Parameters
Type | Name | Description |
---|---|---|
StringDistribution | str1 | Incoming message from |
Bernoulli | areEqual | Incoming message from |
StringDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
StringDistribution |
|
Remarks
The outgoing message is a distribution matching the moments of str2
as the random arguments are varied. The formula is proj[p(str2) sum_(str1,areEqual) p(str1,areEqual) factor(areEqual,str1,str2)]/p(str2)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|