Search Results for

    Show / Hide Table of Contents

    Class GateEnterPartialOp<T>

    Provides outgoing messages for the following factors:

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

    Inheritance
    Object
    GateEnterPartialOp<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), "EnterPartial<>", new Type[]{null, typeof(int), null, typeof(int[])})]
    [FactorMethod(typeof(Gate), "EnterPartial<>", new Type[]{null, typeof(bool), null, typeof(int[])})]
    [Quality(QualityBand.Mature)]
    public static class GateEnterPartialOp<T>
    Type Parameters
    Name Description
    T

    The type of the variable entering the gate.

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

    EnterPartialAverageConditional<TValue>(TValue, TValue[])

    EP message to enterPartial.

    Declaration
    public static TValue[] EnterPartialAverageConditional<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 enterPartial as the random arguments are varied. The formula is proj[p(enterPartial) sum_(value) p(value) factor(enterPartial,selector,value,indices)]/p(enterPartial).

    EnterPartialAverageConditional<TValue, TResultList>(TValue, TResultList)

    EP message to enterPartial.

    Declaration
    public static TResultList EnterPartialAverageConditional<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 enterPartial as the random arguments are varied. The formula is proj[p(enterPartial) sum_(value) p(value) factor(enterPartial,selector,value,indices)]/p(enterPartial).

    EnterPartialAverageLogarithm<TValue>(TValue, TValue[])

    VMP message to enterPartial.

    Declaration
    public static TValue[] EnterPartialAverageLogarithm<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 enterPartial as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enterPartial,selector,value,indices)].

    EnterPartialAverageLogarithm<TValue, TResultList>(TValue, TResultList)

    VMP message to enterPartial.

    Declaration
    public static TResultList EnterPartialAverageLogarithm<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 enterPartial as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enterPartial,selector,value,indices)].

    EnterPartialInit<TValue, TArray>(TValue, Int32[], IArrayFactory<TValue, TArray>)

    Initialize the buffer enterPartial.

    Declaration
    public static TArray EnterPartialInit<TValue, TArray>(TValue value, int[] indices, IArrayFactory<TValue, TArray> factory)
        where TValue : ICloneable
    Parameters
    Type Name Description
    TValue value

    Incoming message from value.

    Int32[] indices

    Constant value for indices.

    IArrayFactory<TValue, TArray> factory
    Returns
    Type Description
    TArray

    Initial value of buffer enterPartial.

    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(enterPartial,selector,value,indices)).

    LogEvidenceRatio<TDist>(IList<TDist>)

    Evidence message for EP.

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

    Incoming message from enterPartial.

    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_(enterPartial) p(enterPartial) factor(enterPartial,selector,value,indices) / sum_enterPartial p(enterPartial) messageTo(enterPartial)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    SelectorAverageConditional(Bernoulli)

    EP message to selector.

    Declaration
    public static Bernoulli SelectorAverageConditional(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 selector conditioned on the given values.

    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(Bernoulli)

    VMP message to selector.

    Declaration
    public static Bernoulli SelectorAverageLogarithm(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 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>, Bernoulli, TDist, Int32[], TDist)

    EP message to value.

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

    Incoming message from enterPartial. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Bernoulli selector

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

    TDist value

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

    Int32[] indices

    Constant value for indices.

    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_(enterPartial,selector) p(enterPartial,selector) factor(enterPartial,selector,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ImproperMessageException

    selector is not a proper distribution.

    ImproperMessageException

    value is not a proper distribution.

    ValueAverageConditional<TDist>(IList<TDist>, Discrete, TDist, Int32[], TDist)

    EP message to value.

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

    Incoming message from enterPartial. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Discrete selector

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

    TDist value

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

    Int32[] indices

    Constant value for indices.

    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_(enterPartial,selector) p(enterPartial,selector) factor(enterPartial,selector,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ImproperMessageException

    selector is not a proper distribution.

    ImproperMessageException

    value is not a proper distribution.

    ValueAverageConditional<TDist>(IList<TDist>, Boolean, Int32[], TDist)

    EP message to value.

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

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

    Boolean selector

    Incoming message from selector.

    Int32[] indices

    Constant value for indices.

    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_(enterPartial,selector) p(enterPartial,selector) factor(enterPartial,selector,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

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

    EP message to value.

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

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

    Int32 selector

    Constant value for selector.

    Int32[] indices

    Constant value for indices.

    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_(enterPartial) p(enterPartial) factor(enterPartial,selector,value,indices)]/p(value).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ValueAverageConditional<TDist>(IList<T>, Boolean, Int32[], TDist)

    EP message to value.

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

    Incoming message from enterPartial.

    Boolean selector

    Incoming message from selector.

    Int32[] indices

    Constant value for indices.

    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_(enterPartial,selector) p(enterPartial,selector) factor(enterPartial,selector,value,indices)]/p(value).

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

    VMP message to value.

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

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

    Bernoulli selector

    Incoming message from selector.

    Int32[] indices

    Constant value for indices.

    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, enterPartial is integrated out before taking the logarithm. The formula is exp(sum_(selector) p(selector) log(sum_enterPartial p(enterPartial) factor(enterPartial,selector,value,indices))).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ValueAverageLogarithm<TDist>(IList<TDist>, Discrete, Int32[], TDist)

    VMP message to value.

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

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

    Discrete selector

    Incoming message from selector.

    Int32[] indices

    Constant value for indices.

    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, enterPartial is integrated out before taking the logarithm. The formula is exp(sum_(selector) p(selector) log(sum_enterPartial p(enterPartial) factor(enterPartial,selector,value,indices))).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ValueAverageLogarithm<TDist>(IList<TDist>, Boolean, Int32[], TDist)

    VMP message to value.

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

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

    Boolean selector

    Incoming message from selector.

    Int32[] indices

    Constant value for indices.

    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, enterPartial is integrated out before taking the logarithm. The formula is exp(sum_(selector) p(selector) log(sum_enterPartial p(enterPartial) factor(enterPartial,selector,value,indices))).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

    ValueAverageLogarithm<TDist>(IList<TDist>, Int32, Int32[], TDist)

    VMP message to value.

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

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

    Int32 selector

    Constant value for selector.

    Int32[] indices

    Constant value for indices.

    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 factor viewed as a function of value with enterPartial integrated out. The formula is sum_enterPartial p(enterPartial) factor(enterPartial,selector,value,indices).

    Exceptions
    Type Condition
    ImproperMessageException

    enterPartial is not a proper distribution.

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