Search Results for

    Show / Hide Table of Contents

    Class GibbsSampling

    Gibbs sampling algorithm - includes block Gibbs sampling

    Inheritance
    Object
    AlgorithmBase
    GibbsSampling
    Implements
    IAlgorithm
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Algorithms
    Assembly: Microsoft.ML.Probabilistic.Compiler.dll
    Syntax
    public class GibbsSampling : AlgorithmBase, IAlgorithm

    Fields

    DefaultSideChannels

    Declaration
    public static bool DefaultSideChannels
    Field Value
    Type Description
    Boolean

    UseSideChannels

    Declaration
    public bool UseSideChannels
    Field Value
    Type Description
    Boolean

    Properties

    BurnIn

    The number of samples to discard at the beginning

    Declaration
    public int BurnIn { get; set; }
    Property Value
    Type Description
    Int32

    DefaultNumberOfIterations

    Default number of iterations for Gibbs sampling

    Declaration
    public override int DefaultNumberOfIterations { get; set; }
    Property Value
    Type Description
    Int32
    Overrides
    AlgorithmBase.DefaultNumberOfIterations

    Name

    Name of the algorithm

    Declaration
    public override string Name { get; }
    Property Value
    Type Description
    String
    Overrides
    AlgorithmBase.Name

    ShortName

    Short name of the algorithm

    Declaration
    public override string ShortName { get; }
    Property Value
    Type Description
    String
    Overrides
    AlgorithmBase.ShortName

    Thin

    Reduction factor when constructing sample and conditional lists

    Declaration
    public int Thin { get; set; }
    Property Value
    Type Description
    Int32

    Methods

    ForEachDefaultQueryType(Action<QueryType>)

    Get the default inference query types for a variable for this algorithm.

    Declaration
    public override void ForEachDefaultQueryType(Action<QueryType> action)
    Parameters
    Type Name Description
    Action<QueryType> action
    Overrides
    AlgorithmBase.ForEachDefaultQueryType(Action<QueryType>)

    GetAlgorithmConversionOperator(Type, IAlgorithm, Boolean, List<Object>)

    Gets the operator which converts a message to/from another algorithm

    Declaration
    public override 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

    Overrides
    AlgorithmBase.GetAlgorithmConversionOperator(Type, IAlgorithm, Boolean, List<Object>)

    GetEvidenceMethodName(List<ICompilerAttribute>)

    Gets the suffix for Gibbs Sampling evidence method Evidence is not supported or supportable for Gibbs. The message update methods are marked as unsupported so that an appropriate error message is generated by the model compiler

    Declaration
    public override string GetEvidenceMethodName(List<ICompilerAttribute> factorAttributes)
    Parameters
    Type Name Description
    List<ICompilerAttribute> factorAttributes
    Returns
    Type Description
    String
    Overrides
    AlgorithmBase.GetEvidenceMethodName(List<ICompilerAttribute>)

    GetMessagePrototype(ChannelInfo, MessageDirection, IExpression, String, IList<QueryType>)

    Get the message prototype in the specified direction

    Declaration
    public override 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

    Path name of message

    IList<QueryType> queryTypes

    The set of queries to support. Only used for marginal channels.

    Returns
    Type Description
    IExpression

    An expression for the method prototype

    Overrides
    AlgorithmBase.GetMessagePrototype(ChannelInfo, MessageDirection, IExpression, String, IList<QueryType>)

    GetOperatorMethodSuffix(List<ICompilerAttribute>)

    Gets the suffix for Gibbs Sampling operator methods

    Declaration
    public override string GetOperatorMethodSuffix(List<ICompilerAttribute> factorAttributes)
    Parameters
    Type Name Description
    List<ICompilerAttribute> factorAttributes
    Returns
    Type Description
    String
    Overrides
    AlgorithmBase.GetOperatorMethodSuffix(List<ICompilerAttribute>)

    GetQueryTypeBinding(QueryType)

    Get the query type binding for Gibbs sampling - this is the path to the given query type relative to the raw marginal type.

    Declaration
    public override string GetQueryTypeBinding(QueryType qt)
    Parameters
    Type Name Description
    QueryType qt

    The query type

    Returns
    Type Description
    String
    Overrides
    AlgorithmBase.GetQueryTypeBinding(QueryType)

    GetVariableFactor(Boolean, Boolean)

    Declaration
    public override Delegate GetVariableFactor(bool derived, bool initialised)
    Parameters
    Type Name Description
    Boolean derived
    Boolean initialised
    Returns
    Type Description
    Delegate
    Overrides
    AlgorithmBase.GetVariableFactor(Boolean, Boolean)

    ModifyFactorAttributes(IExpression, AttributeRegistry<Object, ICompilerAttribute>)

    Allows the algorithm to modify the attributes on a factor. For example, in Gibbs sampling different message types are passed depending on the context. This is signalled to the MessageTransform by attaching a MessagePath attribute to the method invoke expression for the factor. If the factor is a 'variable' pseudo-factor (UsesEqualsDef) then all incoming variables are Distributions. Otherwise, incoming messages will depend on the grouping

    Declaration
    public override void ModifyFactorAttributes(IExpression factorExpression, AttributeRegistry<object, ICompilerAttribute> factorAttributes)
    Parameters
    Type Name Description
    IExpression factorExpression

    The factor expression

    AttributeRegistry<Object, ICompilerAttribute> factorAttributes

    Attribute registry

    Overrides
    AlgorithmBase.ModifyFactorAttributes(IExpression, AttributeRegistry<Object, ICompilerAttribute>)

    Implements

    IAlgorithm
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.