Class StringOfLengthOp
Provides outgoing messages for StringOfLength(Int32, DiscreteChar), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "StringOfLength", new Type[]{})]
[Quality(QualityBand.Experimental)]
public static class StringOfLengthOp
Methods
LengthAverageConditional(StringDistribution, DiscreteChar, Discrete)
EP message to length.
Declaration
public static Discrete LengthAverageConditional(StringDistribution str, DiscreteChar allowedChars, Discrete result)
Parameters
| Type | Name | Description |
|---|---|---|
| StringDistribution | str | Incoming message from |
| DiscreteChar | allowedChars | Constant value for |
| Discrete | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| Discrete |
|
Remarks
The outgoing message is a distribution matching the moments of length as the random arguments are varied. The formula is proj[p(length) sum_(str) p(str) factor(str,length,allowedChars)]/p(length).
LogEvidenceRatio(DiscreteChar, Discrete, StringDistribution)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(DiscreteChar allowedChars, Discrete length, StringDistribution str)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteChar | allowedChars | Constant value for |
| Discrete | length | Incoming message from |
| StringDistribution | str | 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_(length,str) p(length,str) factor(str,length,allowedChars) / sum_str p(str) messageTo(str)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(DiscreteChar, Discrete, String)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(DiscreteChar allowedChars, Discrete length, string str)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteChar | allowedChars | Constant value for |
| Discrete | length | Incoming message from |
| String | str | 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_(length) p(length) factor(str,length,allowedChars)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(DiscreteChar, Int32, String)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(DiscreteChar allowedChars, int length, string str)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteChar | allowedChars | Constant value for |
| Int32 | length | Constant value for |
| String | str | 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(factor(str,length,allowedChars)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
StrAverageConditional(DiscreteChar, Discrete)
EP message to str.
Declaration
public static StringDistribution StrAverageConditional(DiscreteChar allowedChars, Discrete length)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteChar | allowedChars | Constant value for |
| Discrete | length | Incoming message from |
Returns
| Type | Description |
|---|---|
| StringDistribution | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of str as the random arguments are varied. The formula is proj[p(str) sum_(length) p(length) factor(str,length,allowedChars)]/p(str).
StrAverageConditional(DiscreteChar, Int32)
EP message to str.
Declaration
public static StringDistribution StrAverageConditional(DiscreteChar allowedChars, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteChar | allowedChars | Constant value for |
| Int32 | length | Constant value for |
Returns
| Type | Description |
|---|---|
| StringDistribution | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of str conditioned on the given values.