Search Results for

    Show / Hide Table of Contents

    Class DiscreteFromDirichletOp

    Provides outgoing messages for the following factors:

    • Sample(Vector)
    • Discrete(Vector)
    • DiscreteEnum<TEnum>(Vector)
    , given random arguments to the function.

    Inheritance
    Object
    DiscreteFromDirichletOp
    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(Discrete), "Sample", new Type[]{typeof(Vector)})]
    [FactorMethod(new string[]{"sample", "probs"}, typeof(Factor), "Discrete", new Type[]{typeof(Vector)})]
    [FactorMethod(typeof(EnumSupport), "DiscreteEnum<>", new Type[]{})]
    [Quality(QualityBand.Mature)]
    public static class DiscreteFromDirichletOp

    Methods

    AverageLogFactor(Discrete, Dirichlet)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Discrete sample, Dirichlet probs)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Dirichlet probs

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

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(sample,probs) p(sample,probs) log(factor(sample,probs)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    probs is not a proper distribution.

    AverageLogFactor(Discrete, Vector)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Discrete sample, Vector probs)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(sample) p(sample) log(factor(sample,probs)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    AverageLogFactor(Int32, Dirichlet)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(int sample, Dirichlet probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet probs

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

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(probs) p(probs) log(factor(sample,probs)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    probs is not a proper distribution.

    AverageLogFactor(Int32, Vector)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(int sample, Vector probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is log(factor(sample,probs)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    LogAverageFactor(Discrete, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Discrete sample, Discrete to_sample)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Discrete to_sample

    Outgoing message to sample.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(sample) p(sample) factor(sample,probs)).

    LogAverageFactor(Int32, Dirichlet)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(int sample, Dirichlet probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet probs

    Incoming message from probs.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(probs) p(probs) factor(sample,probs)).

    LogAverageFactor(Int32, Vector)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(int sample, Vector probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Vector probs

    Constant value for probs.

    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(sample,probs)).

    LogEvidenceRatio(Discrete, Dirichlet)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Discrete sample, Dirichlet probs)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Dirichlet probs

    Incoming message from probs.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Discrete, Vector)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Discrete sample, Vector probs)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Int32, Dirichlet)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(int sample, Dirichlet probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet probs

    Incoming message from probs.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Int32, Vector)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(int sample, Vector probs)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(factor(sample,probs)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    ProbsAverageConditional(Discrete, Dirichlet, Dirichlet)

    EP message to probs.

    Declaration
    public static Dirichlet ProbsAverageConditional(Discrete sample, Dirichlet probs, Dirichlet result)
    Parameters
    Type Name Description
    Discrete sample

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

    Dirichlet probs

    Incoming message from probs.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ProbsAverageConditional(Discrete, Vector, Dirichlet)

    EP message to probs.

    Declaration
    public static Dirichlet ProbsAverageConditional(Discrete sample, Vector probs, Dirichlet result)
    Parameters
    Type Name Description
    Discrete sample

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

    Vector probs

    Constant value for probs.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ProbsAverageConditional(Int32, Dirichlet)

    EP message to probs.

    Declaration
    public static Dirichlet ProbsAverageConditional(int sample, Dirichlet result)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

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

    ProbsAverageLogarithm(Discrete, Dirichlet)

    VMP message to probs.

    Declaration
    public static Dirichlet ProbsAverageLogarithm(Discrete sample, Dirichlet result)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

    The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except probs. The formula is exp(sum_(sample) p(sample) log(factor(sample,probs))).

    ProbsAverageLogarithm(Int32, Dirichlet)

    VMP message to probs.

    Declaration
    public static Dirichlet ProbsAverageLogarithm(int sample, Dirichlet result)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

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

    ProbsConditional(Int32, Dirichlet)

    Gibbs message to probs.

    Declaration
    public static Dirichlet ProbsConditional(int sample, Dirichlet result)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

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

    SampleAverageConditional(Dirichlet, Discrete)

    EP message to sample.

    Declaration
    public static Discrete SampleAverageConditional(Dirichlet probs, Discrete result)
    Parameters
    Type Name Description
    Dirichlet probs

    Incoming message from probs. 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 sample as the random arguments are varied. The formula is proj[p(sample) sum_(probs) p(probs) factor(sample,probs)]/p(sample).

    Exceptions
    Type Condition
    ImproperMessageException

    probs is not a proper distribution.

    SampleAverageConditional(Vector, Discrete)

    EP message to sample.

    Declaration
    public static Discrete SampleAverageConditional(Vector probs, Discrete result)
    Parameters
    Type Name Description
    Vector probs

    Constant value for probs.

    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 sample conditioned on the given values.

    SampleAverageConditionalInit(Dirichlet)

    Declaration
    public static Discrete SampleAverageConditionalInit(Dirichlet probs)
    Parameters
    Type Name Description
    Dirichlet probs

    Incoming message from probs.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageConditionalInit(Vector)

    Declaration
    public static Discrete SampleAverageConditionalInit(Vector probs)
    Parameters
    Type Name Description
    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageLogarithm(Dirichlet, Discrete)

    VMP message to sample.

    Declaration
    public static Discrete SampleAverageLogarithm(Dirichlet probs, Discrete result)
    Parameters
    Type Name Description
    Dirichlet probs

    Incoming message from probs. 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 exponential of the average log-factor value, where the average is over all arguments except sample. The formula is exp(sum_(probs) p(probs) log(factor(sample,probs))).

    Exceptions
    Type Condition
    ImproperMessageException

    probs is not a proper distribution.

    SampleAverageLogarithm(Vector, Discrete)

    VMP message to sample.

    Declaration
    public static Discrete SampleAverageLogarithm(Vector probs, Discrete result)
    Parameters
    Type Name Description
    Vector probs

    Constant value for probs.

    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 sample conditioned on the given values.

    SampleAverageLogarithmInit(Dirichlet)

    Declaration
    public static Discrete SampleAverageLogarithmInit(Dirichlet probs)
    Parameters
    Type Name Description
    Dirichlet probs

    Incoming message from probs.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageLogarithmInit(Vector)

    Declaration
    public static Discrete SampleAverageLogarithmInit(Vector probs)
    Parameters
    Type Name Description
    Vector probs

    Constant value for probs.

    Returns
    Type Description
    Discrete
    Remarks

    SampleConditional(Vector, Discrete)

    Gibbs message to sample.

    Declaration
    public static Discrete SampleConditional(Vector probs, Discrete result)
    Parameters
    Type Name Description
    Vector probs

    Constant value for probs.

    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 sample conditioned on the given values.

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