Search Results for

    Show / Hide Table of Contents

    Class IntCasesOp

    Provides outgoing messages for CasesInt(Int32, Int32), given random arguments to the function.

    Inheritance
    Object
    IntCasesOp
    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(new string[]{"Cases", "i", "count"}, typeof(Gate), "CasesInt", new Type[]{typeof(int), typeof(int)})]
    [Quality(QualityBand.Mature)]
    public static class IntCasesOp

    Methods

    AverageLogFactor(IList<Bernoulli>, Discrete)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor([SkipIfAllUniform] IList<Bernoulli> cases, Discrete i)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Discrete i

    Incoming message from i.

    Returns
    Type Description
    Double

    Zero.

    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

    cases is not a proper distribution.

    CasesAverageConditional(Discrete, Int32)

    EP message to casesInt.

    Declaration
    public static Bernoulli CasesAverageConditional(Discrete i, int resultIndex)
    Parameters
    Type Name Description
    Discrete i

    Incoming message from i.

    Int32 resultIndex

    Index of the casesInt for which a message is desired.

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the casesInt argument.

    Remarks

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

    CasesAverageLogarithm(Discrete, Int32)

    VMP message to casesInt.

    Declaration
    public static Bernoulli CasesAverageLogarithm(Discrete i, int resultIndex)
    Parameters
    Type Name Description
    Discrete i

    Incoming message from i.

    Int32 resultIndex

    Index of the casesInt for which a message is desired.

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the casesInt argument.

    Remarks

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

    CasesAverageLogarithmInit(Discrete)

    Declaration
    public static DistributionStructArray<Bernoulli, bool> CasesAverageLogarithmInit(Discrete i)
    Parameters
    Type Name Description
    Discrete i

    Incoming message from i.

    Returns
    Type Description
    DistributionStructArray<Bernoulli, Boolean>
    Remarks

    IAverageConditional(IList<Bernoulli>, Discrete)

    EP message to i.

    Declaration
    public static Discrete IAverageConditional(IList<Bernoulli> cases, Discrete result)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    cases is not a proper distribution.

    IAverageLogarithm(IList<Bernoulli>, Discrete)

    VMP message to i.

    Declaration
    public static Discrete IAverageLogarithm(IList<Bernoulli> cases, Discrete result)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    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 i with casesInt integrated out. The formula is sum_casesInt p(casesInt) factor(casesInt,i,count).

    Exceptions
    Type Condition
    ImproperMessageException

    cases is not a proper distribution.

    LogEvidenceRatio(IList<Bernoulli>, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(IList<Bernoulli> cases, Discrete i)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Discrete i

    Incoming message from i.

    Returns
    Type Description
    Double

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

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    cases is not a proper distribution.

    LogEvidenceRatio(IList<Bernoulli>, Int32)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(IList<Bernoulli> cases, int i)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

    Incoming message from casesInt.

    Int32 i

    Constant value for i.

    Returns
    Type Description
    Double

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

    Remarks

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

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