Click or drag to resize
ModelCompiler Class
Microsoft Research
A model compiler takes a model specified in MSL and compiles it into the code required to perform inference in that model, as specified by the inference engine settings and model attributes.
Inheritance Hierarchy
SystemObject
  MicrosoftResearch.InferModelCompiler

Namespace: MicrosoftResearch.Infer
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.6.41128.1 (2.6.41128.1)
Syntax
public class ModelCompiler

The ModelCompiler type exposes the following members.

Methods
  NameDescription
Public methodCompileWithoutParams
Compiles the model defined in MSL by the specified method. The model parameters are not set - they must be set before the model is executed.
Public methodCompileWithParamArray
Compiles the model defined in MSL by the specified method. The model parameters are set to the specified values. This method should only be used when the method has more than 10 parameters, otherwise one of the strongly typed
Compile
methods should be used.
Public methodGivePriorityTo
Resolve ambiguous matches for message operators in favor of the given container. Accumulates with all previous calls.
Public methodRemovePriority
Remove any priority of container given by previous calls to GivePriorityTo.
Public methodSetTo
Configures this model compiler by copying settings from the supplied model compiler.
Top
Properties
  NameDescription
Public propertyAddComments
If true, comments will be added to the generated code.
Public propertyAlgorithm
The inference algorithm to use.
Public propertyAllowDerivedParents
If true, allow factor arguments marked 'stochastic' to be derived. This can cause inference to diverge on some models.
Public propertyAllowSerialInitialisers
Allow initialisation to use serial schedules.
Public propertyCatchExceptions
If true, compiler exceptions are caught and displayed in the transform browser, rather than propagating to the caller.
Public propertyDeclarationProvider
Declaration provider for model defined in MSL
Public propertyFreeMemory
Trade memory for time. If true, memory usage is reduced for increase in time. Temporary storage will be freed when inference completes, requiring re-allocation every time inference is run. If false, memory usage is increased for reduction in time. Temporary storage will be kept and re-used for later inference runs.
Public propertyGeneratedSourceFolder
The path (absolute or relative) where source code files will be generated.
Public propertyGenerateInMemory
Controls if inference assembly is generated in memory or on disk.
Public propertyIgnoreEqualObservedValuesForReferenceTypes
Let's you control what happens when you set an observed value which is equal to the old observed value (for reference types). If this property is true, setting an equal value will be ignored. If false, setting an equal value may cause inference to be re-run.
Public propertyIgnoreEqualObservedValuesForValueTypes
Let's you control what happens when you set an observed value which is equal to the old observed value (for value types). If this property is true, setting an equal value will be ignored. If false, setting an equal value may cause inference to be re-run.
Public propertyIncludeDebugInformation
Controls if debug information is included in generated DLLs. If true, debug information will be included which allows stepping through the generated code in a debugger.
Public propertyOptimiseInferenceCode
Optimises generated code by removing redundant messages or operations.
Public propertyPriorityList
A list of message operator containers, highest priority first.
Public propertyRecommendedQuality
Sets the quality band at which is recommended for running inference. By default this is QualityBand.Preview.
Public propertyRequiredQuality
Sets the component quality band which is required for running inference. By default this is QualityBand.Experimental.
Public propertyReturnCopies
If true, code will be generated to return copies of the internal marginal distributions. If this is not done, the returned marginals are volatile and may be modified in place when inference runs again. Set to false to save memory/time.
Public propertyShowProgress
If true, prints compilation progress information to the console during model compilation.
Public propertyShowWarnings
If true, compiler warnings are printed to the console.
Public propertyTreatWarningsAsErrors
If true, compiler warnings are treated as errors.
Public propertyUnrollLoops
If true, all loops with constant bounds will be unrolled.
Public propertyUseExistingSourceFiles
If true, existing source code files will be used instead of re-generated.
Public propertyUseParallelForLoops
If true, use Parallel.For() instead of top-level for loops in the generated code. Requires the Microsoft Parallel Extensions to be installed.
Public propertyUseSerialSchedules
Find serial schedules for graphs with offset indexing.
Public propertyUseSpecialFirstIteration
Experimental feature: generate a schedule using InitializeTo for the first iteration and another schedule ignoring InitializeTo for the remaining iterations.
Public propertyWriteSourceFiles
Controls if source code files are written to disk. If true, source code files will be written out to the GeneratedSourceFolder.
Top
Events
  NameDescription
Public eventCompiled
Event raised after a model is compiled or fails to compile.
Public eventCompiling
Event raised before a model is compiled.
Public eventParametersChanged
Event raised when a compilation parameter is changed.
Top
See Also