Search Results for

    Show / Hide Table of Contents

    Class CasesOp

    Provides outgoing messages for Cases(Boolean), given random arguments to the function.

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

    Methods

    AverageLogFactor(IList<Bernoulli>, Bernoulli)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(IList<Bernoulli> cases, Bernoulli b)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Bernoulli b

    Incoming message from b.

    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.

    BAverageConditional(IList<Bernoulli>)

    EP message to b.

    Declaration
    public static Bernoulli BAverageConditional(IList<Bernoulli> cases)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the b argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    cases is not a proper distribution.

    BAverageLogarithm(IList<Bernoulli>)

    VMP message to b.

    Declaration
    public static Bernoulli BAverageLogarithm(IList<Bernoulli> cases)
    Parameters
    Type Name Description
    IList<Bernoulli> cases

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

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the b argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    cases is not a proper distribution.

    CasesAverageConditional<BernoulliList>(Bernoulli, BernoulliList)

    EP message to cases.

    Declaration
    public static BernoulliList CasesAverageConditional<BernoulliList>(Bernoulli b, BernoulliList result)
        where BernoulliList : IList<Bernoulli>
    Parameters
    Type Name Description
    Bernoulli b

    Incoming message from b.

    BernoulliList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    BernoulliList

    result

    Type Parameters
    Name Description
    BernoulliList

    The type of the outgoing message.

    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_(b) p(b) factor(cases,b)]/p(cases).

    CasesAverageConditionalInit()

    Declaration
    public static DistributionStructArray<Bernoulli, bool> CasesAverageConditionalInit()
    Returns
    Type Description
    DistributionStructArray<Bernoulli, Boolean>
    Remarks

    CasesAverageLogarithm<BernoulliList>(Bernoulli, BernoulliList)

    VMP message to cases.

    Declaration
    public static BernoulliList CasesAverageLogarithm<BernoulliList>(Bernoulli b, BernoulliList result)
        where BernoulliList : IList<Bernoulli>
    Parameters
    Type Name Description
    Bernoulli b

    Incoming message from b.

    BernoulliList result

    Modified to contain the outgoing message.

    Returns
    Type Description
    BernoulliList

    result

    Type Parameters
    Name Description
    BernoulliList

    The type of the outgoing message.

    Remarks

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

    CasesAverageLogarithmInit()

    Declaration
    public static DistributionStructArray<Bernoulli, bool> CasesAverageLogarithmInit()
    Returns
    Type Description
    DistributionStructArray<Bernoulli, Boolean>
    Remarks

    CasesDeriv<DistributionType>(DistributionType)

    Declaration
    public static DistributionType CasesDeriv<DistributionType>(DistributionType result)
        where DistributionType : SettableToUniform
    Parameters
    Type Name Description
    DistributionType result
    Returns
    Type Description
    DistributionType
    Type Parameters
    Name Description
    DistributionType

    LogEvidenceRatio(IList<Bernoulli>, Bernoulli)

    Evidence message for EP.

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

    Incoming message from cases.

    Bernoulli b

    Incoming message from b.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(IList<Bernoulli>, Boolean)

    Evidence message for EP.

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

    Incoming message from cases.

    Boolean b

    Constant value for b.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(cases) p(cases) factor(cases,b) / sum_cases p(cases) messageTo(cases)). 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.