Interface IAlgorithm
Interface for inference algorithms
Namespace: Microsoft.ML.Probabilistic.Models.Attributes
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
public interface IAlgorithm
Properties
DefaultNumberOfIterations
Default number of iterations for this algorithm
Declaration
int DefaultNumberOfIterations { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Name
The name
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
ShortName
Short name for the inference algorithm
Declaration
string ShortName { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
ForEachDefaultQueryType(Action<QueryType>)
Get the default inference query types for a variable for this algorithm.
Declaration
void ForEachDefaultQueryType(Action<QueryType> action)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<QueryType> | action |
GetAlgorithmConversionOperator(Type, IAlgorithm, Boolean, List<Object>)
Gets the operator which converts a message to/from another algorithm
Declaration
MethodReference GetAlgorithmConversionOperator(Type channelType, IAlgorithm alg2, bool isFromFactor, List<object> args)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | channelType | Type of message |
| IAlgorithm | alg2 | The other algorithm |
| Boolean | isFromFactor | True if from, false if to |
| List<Object> | args | Where to add arguments of the operator |
Returns
| Type | Description |
|---|---|
| MethodReference | A method reference for the operator |
GetEvidenceMethodName(List<ICompilerAttribute>)
Gets the suffix for this algorithm's evidence method
Declaration
string GetEvidenceMethodName(List<ICompilerAttribute> factorAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ICompilerAttribute> | factorAttributes |
Returns
| Type | Description |
|---|---|
| String |
GetMessagePrototype(ChannelInfo, MessageDirection, IExpression, String, IList<QueryType>)
Get the message prototype for this algorithm in the specified direction
Declaration
IExpression GetMessagePrototype(ChannelInfo channelInfo, MessageDirection direction, IExpression marginalPrototypeExpression, string path, IList<QueryType> queryTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| ChannelInfo | channelInfo | The channel information |
| MessageDirection | direction | The direction |
| IExpression | marginalPrototypeExpression | The marginal prototype expression |
| String | path | Sub-channel path |
| IList<QueryType> | queryTypes |
Returns
| Type | Description |
|---|---|
| IExpression |
GetOperatorMethodSuffix(List<ICompilerAttribute>)
Gets the suffix for this algorithm's operator methods
Declaration
string GetOperatorMethodSuffix(List<ICompilerAttribute> factorAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ICompilerAttribute> | factorAttributes |
Returns
| Type | Description |
|---|---|
| String |
GetQueryTypeBinding(QueryType)
Get the query type binding - this is the path to the given query type relative to the raw marginal type.
Declaration
string GetQueryTypeBinding(QueryType qt)
Parameters
| Type | Name | Description |
|---|---|---|
| QueryType | qt | The query type |
Returns
| Type | Description |
|---|---|
| String |
GetVariableFactor(Boolean, Boolean)
Declaration
Delegate GetVariableFactor(bool derived, bool initialised)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | derived | |
| Boolean | initialised |
Returns
| Type | Description |
|---|---|
| Delegate |
ModifyFactorAttributes(IExpression, AttributeRegistry<Object, ICompilerAttribute>)
Allows the algorithm to modify the attributes on a factor. For example context-specific message attributes on a method invoke expression
Declaration
void ModifyFactorAttributes(IExpression factorExpression, AttributeRegistry<object, ICompilerAttribute> factorAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| IExpression | factorExpression | The expression |
| AttributeRegistry<Object, ICompilerAttribute> | factorAttributes | Attribute registry |