Search Results for

    Show / Hide Table of Contents

    Class GateEnterOp<T>

    Provides outgoing messages for the following factors:

    • Enter<T>(Boolean, T)
    • Enter<T>(Int32, T)
    , given random arguments to the function.

    Inheritance
    Object
    GateEnterOp<T>
    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.Factors
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [FactorMethod(typeof(Gate), "Enter<>", new Type[]{null, typeof(bool), null})]
    [FactorMethod(typeof(Gate), "Enter<>", new Type[]{null, typeof(int), null})]
    [Quality(QualityBand.Mature)]
    public static class GateEnterOp<T>
    Type Parameters
    Name Description
    T

    Fields

    ForceProper

    Force proper messages

    Declaration
    public static bool ForceProper
    Field Value
    Type Description
    Boolean

    Methods

    AverageLogFactor()

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor()
    Returns
    Type Description
    Double

    Zero.

    Remarks

    The formula for the result is log(factor(enter,selector,value)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    EnterAverageConditional<TValue>(TValue, TValue[])

    EP message to enter.

    Declaration
    public static TValue[] EnterAverageConditional<TValue>(TValue value, TValue[] result)
    Parameters
    Type Name Description
    TValue value

    Incoming message from value.

    TValue[] result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TValue[]

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    Remarks

    The outgoing message is a distribution matching the moments of enter as the random arguments are varied. The formula is proj[p(enter) sum_(value) p(value) factor(enter,selector,value)]/p(enter).

    EnterAverageConditional<TValue, TResultList>(TValue, TResultList)

    EP message to enter.

    Declaration
    public static TResultList EnterAverageConditional<TValue, TResultList>(TValue value, TResultList result)
        where TResultList : CanSetAllElementsTo<TValue>
    Parameters
    Type Name Description
    TValue value

    Incoming message from value.

    TResultList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TResultList

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    TResultList

    The type of the outgoing message.

    Remarks

    The outgoing message is a distribution matching the moments of enter as the random arguments are varied. The formula is proj[p(enter) sum_(value) p(value) factor(enter,selector,value)]/p(enter).

    EnterAverageLogarithm<TValue>(TValue, TValue[])

    VMP message to enter.

    Declaration
    public static TValue[] EnterAverageLogarithm<TValue>(TValue value, TValue[] result)
    Parameters
    Type Name Description
    TValue value

    Incoming message from value.

    TValue[] result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TValue[]

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    Remarks

    The outgoing message is a distribution matching the moments of enter as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enter,selector,value)].

    EnterAverageLogarithm<TValue, TResultList>(TValue, TResultList)

    VMP message to enter.

    Declaration
    public static TResultList EnterAverageLogarithm<TValue, TResultList>(TValue value, TResultList result)
        where TResultList : CanSetAllElementsTo<TValue>
    Parameters
    Type Name Description
    TValue value

    Incoming message from value.

    TResultList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TResultList

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    TResultList

    The type of the outgoing message.

    Remarks

    The outgoing message is a distribution matching the moments of enter as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enter,selector,value)].

    EnterInit<TValue, TArray>(Discrete, TValue, IArrayFactory<TValue, TArray>)

    Initialize the buffer enter.

    Declaration
    public static TArray EnterInit<TValue, TArray>(Discrete selector, TValue value, IArrayFactory<TValue, TArray> factory)
        where TValue : ICloneable
    Parameters
    Type Name Description
    Discrete selector

    Incoming message from selector.

    TValue value

    Incoming message from value.

    IArrayFactory<TValue, TArray> factory
    Returns
    Type Description
    TArray

    Initial value of buffer enter.

    Type Parameters
    Name Description
    TValue

    The type of the incoming message from value.

    TArray

    The type of an array that can be produced by factory.

    Remarks

    LogAverageFactor()

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor()
    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(factor(enter,selector,value)).

    LogEvidenceRatio<TDist>(IList<TDist>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<TDist>(IList<TDist> enter)
        where TDist : IDistribution<T>
    Parameters
    Type Name Description
    IList<TDist> enter

    Incoming message from enter.

    Returns
    Type Description
    Double

    Logarithm of the factor's contribution the EP model evidence.

    Type Parameters
    Name Description
    TDist
    Remarks

    The formula for the result is log(sum_(enter) p(enter) factor(enter,selector,value) / sum_enter p(enter) messageTo(enter)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    SelectorAverageConditional(Discrete)

    EP message to selector.

    Declaration
    public static Discrete SelectorAverageConditional(Discrete result)
    Parameters
    Type Name Description
    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

    The outgoing message is the factor viewed as a function of selector conditioned on the given values.

    SelectorAverageLogarithm(Discrete)

    VMP message to selector.

    Declaration
    public static Discrete SelectorAverageLogarithm(Discrete result)
    Parameters
    Type Name Description
    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

    The outgoing message is the factor viewed as a function of selector conditioned on the given values.

    ValueAverageConditional<TDist>(IList<TDist>, Discrete, TDist, TDist)

    EP message to value.

    Declaration
    public static TDist ValueAverageConditional<TDist>([SkipIfAllUniform] IList<TDist> enter, Discrete selector, TDist value, TDist result)
        where TDist : IDistribution<T>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>, SettableToPower<TDist>
    Parameters
    Type Name Description
    IList<TDist> enter

    Incoming message from enter. Must be a proper distribution. If all elements are uniform, the result will be uniform.

    Discrete selector

    Incoming message from selector.

    TDist value

    Incoming message from value.

    TDist result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TDist

    result

    Type Parameters
    Name Description
    TDist

    The type of the distribution over the variable entering the gate.

    Remarks

    The outgoing message is a distribution matching the moments of value as the random arguments are varied. The formula is proj[p(value) sum_(enter,selector) p(enter,selector) factor(enter,selector,value)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enter is not a proper distribution.

    ValueAverageConditional<TDist>(IList<TDist>, Int32, TDist)

    EP message to value.

    Declaration
    public static TDist ValueAverageConditional<TDist>([SkipIfAllUniform] IList<TDist> enter, int selector, TDist result)
        where TDist : IDistribution<T>, SettableTo<TDist>
    Parameters
    Type Name Description
    IList<TDist> enter

    Incoming message from enter. Must be a proper distribution. If all elements are uniform, the result will be uniform.

    Int32 selector

    Incoming message from selector.

    TDist result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TDist

    result

    Type Parameters
    Name Description
    TDist

    The type of the distribution over the variable entering the gate.

    Remarks

    The outgoing message is a distribution matching the moments of value as the random arguments are varied. The formula is proj[p(value) sum_(enter,selector) p(enter,selector) factor(enter,selector,value)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enter is not a proper distribution.

    ValueAverageLogarithm<TDist>(IList<TDist>, Discrete, TDist)

    VMP message to value.

    Declaration
    public static TDist ValueAverageLogarithm<TDist>([SkipIfAllUniform] IList<TDist> enter, Discrete selector, TDist result)
        where TDist : IDistribution<T>, SettableToProduct<TDist>, SettableToPower<TDist>
    Parameters
    Type Name Description
    IList<TDist> enter

    Incoming message from enter. Must be a proper distribution. If all elements are uniform, the result will be uniform.

    Discrete selector

    Incoming message from selector.

    TDist result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TDist

    result

    Type Parameters
    Name Description
    TDist

    The type of the distribution over the variable entering the gate.

    Remarks

    The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except value. Because the factor is deterministic, enter is integrated out before taking the logarithm. The formula is exp(sum_(selector) p(selector) log(sum_enter p(enter) factor(enter,selector,value))).

    Exceptions
    Type Condition
    ImproperMessageException

    enter is not a proper distribution.

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