Click or drag to resize
SharedVariableDomainType Class
Microsoft Research
Abstract base class for shared variables. Shared variables allow a model to be split into submodels in which variables are shared. Each submodel can have many copies.
Inheritance Hierarchy
SystemObject
  MicrosoftResearch.Infer.ModelsSharedVariableDomainType

Namespace: MicrosoftResearch.Infer.Models
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.6.41128.1 (2.6.41128.1)
Syntax
public abstract class SharedVariable<DomainType> : ISharedVariable

Type Parameters

DomainType
Domian type of the variable

The SharedVariableDomainType type exposes the following members.

Methods
  NameDescription
Public methodGetCopyFor
Gets a copy of the variable for the specified model.
Public methodGetEvidenceCorrection
Gets the evidence correction for this shared variable.
Public methodInferOutput(IGeneratedAlgorithm, Model, Int32)
Infer the shared variable's output message for the given model and batch number.
Public methodInferOutput(InferenceEngine, Model, Int32)
Infer the shared variable's output message for the given model and batch number.
Public methodMarginalT
Get the marginal distribution for the shared variable, converted to type T.
Public methodNamed
Inline method for naming a shared variable.
Public methodStatic memberRandomDistributionType(DistributionType, Boolean)
Creates a shared random variable with the specified prior distribution.
Public methodStatic memberRandomDistributionArrayType(Range, DistributionArrayType, Boolean)
Creates a 1D array of shared random variables of size given by the specified range.
Public methodStatic memberRandomDistributionArrayType(VariableArrayDomainType, Range, DistributionArrayType, Boolean)
Creates a 1D jagged array of shared random variables.
Public methodStatic memberRandomItemType, DistributionArrayType(ItemType, Range, DistributionArrayType, Boolean)
Creates a generic jagged array of shared random variables.
Public methodSetDefinitionTo
Sets the definition of the shared variable.
Public methodSetInput
Sets the shared variable's inbox for a given model and batch.
Top
Fields
  NameDescription
Public fieldName
Name of the shared variable.
Top
Properties
  NameDescription
Public propertyIsEvidenceVariable
Marks this shared variable as one that calculates evidence
Top
Remarks
A typical use of this is for large data sets where the likelihood parts of the model cannot all fit in memory. The solution is to divide the data into chunks (or 'batches'), and specify a single submodel which includes the likelihood factors and variables for one chunk, along with the shared parameters; the number of copies of the submodel is set to the number of chunks. In a related pattern, there are one or more additional submodels for defining the parameter variables.
See Also