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