Search Results for

    Show / Hide Table of Contents

    Class GateExitOp<T>

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

    Inheritance
    Object
    GateExitOp<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), "Exit<>", new Type[]{})]
    [Quality(QualityBand.Mature)]
    public static class GateExitOp<T>
    Type Parameters
    Name Description
    T

    The type of the variable exiting the gate.

    Methods

    AverageLogFactor<TDist>(TDist, TDist)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor<TDist>(TDist exit, TDist to_exit)
        where TDist : IDistribution<T>, CanGetAverageLog<TDist>
    Parameters
    Type Name Description
    TDist exit

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

    TDist to_exit

    Outgoing message to exit.

    Returns
    Type Description
    Double

    Zero.

    Type Parameters
    Name Description
    TDist

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

    Remarks

    In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    exit is not a proper distribution.

    CasesAverageConditional<TDist>(TDist, TDist, Int32)

    EP message to cases.

    Declaration
    public static Bernoulli CasesAverageConditional<TDist>(TDist exit, TDist values, int resultIndex)
        where TDist : IDistribution<T>, CanGetLogAverageOf<TDist>
    Parameters
    Type Name Description
    TDist exit

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

    TDist values

    Incoming message from values.

    Int32 resultIndex

    Index of the cases for which a message is desired.

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the cases argument.

    Type Parameters
    Name Description
    TDist

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

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    exit is not a proper distribution.

    CasesAverageConditional<TDist>(TDist, IList<T>, Int32)

    EP message to cases.

    Declaration
    public static Bernoulli CasesAverageConditional<TDist>(TDist exit, IList<T> values, int resultIndex)
        where TDist : CanGetLogProb<T>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<T> values

    Incoming message from values.

    Int32 resultIndex

    Index of the cases for which a message is desired.

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the cases argument.

    Type Parameters
    Name Description
    TDist

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

    Remarks

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

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

    VMP message to cases.

    Declaration
    public static Bernoulli CasesAverageLogarithm<TDist>(TDist exit, [SkipIfAllUniform] IList<TDist> values, int resultIndex)
        where TDist : CanGetAverageLog<TDist>
    Parameters
    Type Name Description
    TDist exit

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

    IList<TDist> values

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

    Int32 resultIndex

    Index of the cases for which a message is desired.

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the cases argument.

    Type Parameters
    Name Description
    TDist

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

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    exit is not a proper distribution.

    ImproperMessageException

    values is not a proper distribution.

    ExitAverageConditional<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)

    EP message to exit.

    Declaration
    public static TDist ExitAverageConditional<TDist>(TDist exit, IList<Bernoulli> cases, IList<TDist> values, TDist result)
        where TDist : IDistribution<T>, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Bernoulli> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageConditional<TDist>(TDist, IList<Bernoulli>, IList<T>, TDist)

    EP message to exit.

    Declaration
    public static TDist ExitAverageConditional<TDist>(TDist exit, IList<Bernoulli> cases, IList<T> values, TDist result)
        where TDist : ICloneable, HasPoint<T>, SettableToWeightedSum<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Bernoulli> cases

    Incoming message from cases.

    IList<T> values

    Incoming message from values.

    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 exiting the gate.

    Remarks

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

    ExitAverageConditional<TDist>(TDist, IList<Boolean>, IList<TDist>, TDist)

    EP message to exit.

    Declaration
    public static TDist ExitAverageConditional<TDist>(TDist exit, IList<bool> cases, IList<TDist> values, TDist result)
        where TDist : SettableTo<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Boolean> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageConditional1<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)

    EP message to exit.

    Declaration
    public static TDist ExitAverageConditional1<TDist>(TDist exit, IList<Bernoulli> cases, IList<TDist> values, TDist result)
        where TDist : IDistribution<T>, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Bernoulli> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageConditional2<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)

    EP message to exit.

    Declaration
    public static TDist ExitAverageConditional2<TDist>(TDist exit, IList<Bernoulli> cases, [SkipIfAllUniform] IList<TDist> values, TDist result)
        where TDist : SettableTo<TDist>, ICloneable, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Bernoulli> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageConditionalInit<TDist>(IList<TDist>)

    Declaration
    public static TDist ExitAverageConditionalInit<TDist>(IList<TDist> values)
        where TDist : ICloneable
    Parameters
    Type Name Description
    IList<TDist> values

    Incoming message from values.

    Returns
    Type Description
    TDist
    Type Parameters
    Name Description
    TDist

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

    Remarks

    ExitAverageLogarithm<TDist>(TDist, IList<Boolean>, IList<TDist>, TDist)

    VMP message to exit.

    Declaration
    public static TDist ExitAverageLogarithm<TDist>(TDist exit, IList<bool> cases, IList<TDist> values, TDist result)
        where TDist : SettableTo<TDist>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Boolean> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageLogarithm<TDist>(IList<Bernoulli>, IList<TDist>, TDist)

    VMP message to exit.

    Declaration
    public static TDist ExitAverageLogarithm<TDist>(IList<Bernoulli> cases, [SkipIfAllUniform] IList<TDist> values, TDist result)
        where TDist : ICloneable, SettableToProduct<TDist>, SettableToPower<TDist>, CanGetAverageLog<TDist>, SettableToUniform, SettableTo<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>
    Parameters
    Type Name Description
    IList<Bernoulli> cases

    Incoming message from cases.

    IList<TDist> values

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

    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 exiting the gate.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    values is not a proper distribution.

    ExitAverageLogarithmInit<TDist>(IList<TDist>)

    Declaration
    public static TDist ExitAverageLogarithmInit<TDist>(IList<TDist> values)
        where TDist : ICloneable
    Parameters
    Type Name Description
    IList<TDist> values

    Incoming message from values.

    Returns
    Type Description
    TDist
    Type Parameters
    Name Description
    TDist

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

    Remarks

    LogEvidenceRatio<TDist>(TDist, TDist)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<TDist>(TDist exit, TDist to_exit)
        where TDist : IDistribution<T>, CanGetLogAverageOf<TDist>
    Parameters
    Type Name Description
    TDist exit

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

    TDist to_exit

    Outgoing message to exit.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    TDist

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

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    exit is not a proper distribution.

    LogEvidenceRatio<TDist>(TDist, IList<Boolean>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<TDist>(TDist exit, IList<bool> cases)
        where TDist : IDistribution<T>
    Parameters
    Type Name Description
    TDist exit

    Incoming message from exit.

    IList<Boolean> cases

    Incoming message from cases.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    TDist

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

    Remarks

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

    ValuesAverageConditional<TExit>(TExit, TExit[])

    EP message to values.

    Declaration
    public static TExit[] ValuesAverageConditional<TExit>(TExit exit, TExit[] result)
    Parameters
    Type Name Description
    TExit exit

    Incoming message from exit.

    TExit[] result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TExit[]

    result

    Type Parameters
    Name Description
    TExit

    The type of the message from exit.

    Remarks

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

    ValuesAverageConditional<TExit, TResultList>(TExit, TResultList)

    EP message to values.

    Declaration
    public static TResultList ValuesAverageConditional<TExit, TResultList>(TExit exit, TResultList result)
        where TResultList : CanSetAllElementsTo<TExit>
    Parameters
    Type Name Description
    TExit exit

    Incoming message from exit.

    TResultList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TResultList

    result

    Type Parameters
    Name Description
    TExit

    The type of the message from exit.

    TResultList

    The type of the outgoing message.

    Remarks

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

    ValuesAverageLogarithm<TExit>(TExit, TExit[])

    Declaration
    public static TExit[] ValuesAverageLogarithm<TExit>(TExit exit, TExit[] result)
    Parameters
    Type Name Description
    TExit exit
    TExit[] result
    Returns
    Type Description
    TExit[]
    Type Parameters
    Name Description
    TExit

    The type of the message from exit.

    ValuesAverageLogarithm<TExit, TResultList>(TExit, TResultList)

    VMP message to values.

    Declaration
    public static TResultList ValuesAverageLogarithm<TExit, TResultList>(TExit exit, TResultList result)
        where TResultList : CanSetAllElementsTo<TExit>
    Parameters
    Type Name Description
    TExit exit

    Incoming message from exit.

    TResultList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TResultList

    result

    Type Parameters
    Name Description
    TExit

    The type of the message from exit.

    TResultList

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of values with exit integrated out. The formula is sum_exit p(exit) factor(exit,cases,values).

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