Search Results for

    Show / Hide Table of Contents

    Class GateEnterPartialTwoOp

    Provides outgoing messages for EnterPartialTwo<T>(Boolean, Boolean, T, Int32[]), given random arguments to the function.

    Inheritance
    Object
    GateEnterPartialTwoOp
    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), "EnterPartialTwo<>", new Type[]{})]
    [Quality(QualityBand.Mature)]
    public static class GateEnterPartialTwoOp

    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(enterPartialTwo,case0,case1,value,indices)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Case0AverageConditional(Bernoulli)

    EP message to case0.

    Declaration
    public static Bernoulli Case0AverageConditional(Bernoulli result)
    Parameters
    Type Name Description
    Bernoulli result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Bernoulli

    result

    Remarks

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

    Case0AverageLogarithm<TValue>(IList<TValue>, TValue, Int32[], Bernoulli)

    VMP message to case0.

    Declaration
    public static Bernoulli Case0AverageLogarithm<TValue>(IList<TValue> enterPartialTwo, TValue value, int[] indices, Bernoulli result)
    Parameters
    Type Name Description
    IList<TValue> enterPartialTwo

    Incoming message from enterPartialTwo.

    TValue value

    Incoming message from value.

    Int32[] indices

    Constant value for indices.

    Bernoulli result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Bernoulli

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    Remarks

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

    Case1AverageConditional(Bernoulli)

    EP message to case1.

    Declaration
    public static Bernoulli Case1AverageConditional(Bernoulli result)
    Parameters
    Type Name Description
    Bernoulli result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Bernoulli

    result

    Remarks

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

    Case1AverageLogarithm<TValue>(IList<TValue>, TValue, Int32[], Bernoulli)

    VMP message to case1.

    Declaration
    public static Bernoulli Case1AverageLogarithm<TValue>(IList<TValue> enterPartialTwo, TValue value, int[] indices, Bernoulli result)
    Parameters
    Type Name Description
    IList<TValue> enterPartialTwo

    Incoming message from enterPartialTwo.

    TValue value

    Incoming message from value.

    Int32[] indices

    Constant value for indices.

    Bernoulli result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Bernoulli

    result

    Type Parameters
    Name Description
    TValue

    The type of the message from value.

    Remarks

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

    EnterPartialTwoAverageConditional<TValue, TResultList>(TValue, TResultList)

    EP message to enterPartialTwo.

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

    Incoming message from value. Must be a proper distribution. If uniform, the result will be uniform.

    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 enterPartialTwo as the random arguments are varied. The formula is proj[p(enterPartialTwo) sum_(value) p(value) factor(enterPartialTwo,case0,case1,value,indices)]/p(enterPartialTwo).

    Exceptions
    Type Condition
    ImproperMessageException

    value is not a proper distribution.

    EnterPartialTwoAverageLogarithm<TValue, TResultList>(TValue, TResultList)

    VMP message to enterPartialTwo.

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

    Incoming message from value. Must be a proper distribution. If uniform, the result will be uniform.

    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 enterPartialTwo as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enterPartialTwo,case0,case1,value,indices)].

    Exceptions
    Type Condition
    ImproperMessageException

    value is not a proper distribution.

    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(enterPartialTwo,case0,case1,value,indices)).

    LogEvidenceRatio()

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio()
    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(factor(enterPartialTwo,case0,case1,value,indices)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    ValueAverageConditional<TValue>(IList<TValue>, Bernoulli, Bernoulli, TValue, Int32[], TValue)

    EP message to value.

    Declaration
    public static TValue ValueAverageConditional<TValue>([SkipIfAllUniform] IList<TValue> enterPartialTwo, Bernoulli case0, Bernoulli case1, TValue value, int[] indices, TValue result)
        where TValue : ICloneable, SettableToUniform, SettableToProduct<TValue>, SettableToRatio<TValue>, SettableToWeightedSum<TValue>, CanGetLogAverageOf<TValue>
    Parameters
    Type Name Description
    IList<TValue> enterPartialTwo

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

    Bernoulli case0

    Incoming message from case0.

    Bernoulli case1

    Incoming message from case1.

    TValue value

    Incoming message from value.

    Int32[] indices

    Constant value for indices.

    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 value as the random arguments are varied. The formula is proj[p(value) sum_(enterPartialTwo,case0,case1) p(enterPartialTwo,case0,case1) factor(enterPartialTwo,case0,case1,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartialTwo is not a proper distribution.

    ValueAverageConditional<TValue, TDomain>(IList<TValue>, Boolean, Boolean, Int32[], TValue)

    EP message to value.

    Declaration
    public static TValue ValueAverageConditional<TValue, TDomain>([SkipIfAllUniform] IList<TValue> enterPartialTwo, bool case1, bool case2, int[] indices, TValue result)
        where TValue : IDistribution<TDomain>, SettableTo<TValue>
    Parameters
    Type Name Description
    IList<TValue> enterPartialTwo

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

    Boolean case1

    Constant value for case1.

    Boolean case2
    Int32[] indices

    Constant value for indices.

    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.

    TDomain

    The type of 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_(enterPartialTwo) p(enterPartialTwo) factor(enterPartialTwo,case0,case1,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartialTwo is not a proper distribution.

    ValueAverageLogarithm<TValue>(IList<TValue>, Bernoulli, Bernoulli, Int32[], TValue)

    VMP message to value.

    Declaration
    public static TValue ValueAverageLogarithm<TValue>([SkipIfAllUniform] IList<TValue> enterPartialTwo, Bernoulli case0, Bernoulli case1, int[] indices, TValue result)
        where TValue : ICloneable, SettableToProduct<TValue>, SettableToPower<TValue>
    Parameters
    Type Name Description
    IList<TValue> enterPartialTwo

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

    Bernoulli case0

    Incoming message from case0.

    Bernoulli case1

    Incoming message from case1.

    Int32[] indices

    Constant value for indices.

    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 the exponential of the average log-factor value, where the average is over all arguments except value. Because the factor is deterministic, enterPartialTwo is integrated out before taking the logarithm. The formula is exp(sum_(case0,case1) p(case0,case1) log(sum_enterPartialTwo p(enterPartialTwo) factor(enterPartialTwo,case0,case1,value,indices))).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartialTwo is not a proper distribution.

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