Search Results for

    Show / Hide Table of Contents

    Class BernoulliFromLogOddsOp

    Provides outgoing messages for BernoulliFromLogOdds(Double), given random arguments to the function.

    Inheritance
    Object
    BernoulliFromLogOddsOp
    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(Factor), "BernoulliFromLogOdds", new Type[]{})]
    [Quality(QualityBand.Experimental)]
    public static class BernoulliFromLogOddsOp
    Remarks

    Performs KL minimization using gradient matching, a distributed gradient descent algorithm.

    Fields

    ForceProper

    Declaration
    public static bool ForceProper
    Field Value
    Type Description
    Boolean

    Methods

    AverageLogFactor(Bernoulli, Gaussian)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Bernoulli sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Gaussian logOdds

    Incoming message from logOdds. Must be a proper distribution. If 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,logOdds) p(sample,logOdds) log(factor(sample,logOdds)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    AverageLogFactor(Bernoulli, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Bernoulli sample, double logOdds)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Double logOdds

    Constant value for logOdds.

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

    AverageLogFactor(Boolean, Gaussian)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(bool sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Gaussian logOdds

    Incoming message from logOdds. Must be a proper distribution. If 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_(logOdds) p(logOdds) log(factor(sample,logOdds)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    AverageLogFactor(Boolean, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(bool sample, double logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double logOdds

    Constant value for logOdds.

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

    LogAverageFactor(Boolean, Gaussian)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(bool sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Gaussian logOdds

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

    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_(logOdds) p(logOdds) factor(sample,logOdds)).

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    LogAverageFactor(Boolean, Double)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(bool sample, double logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double logOdds

    Constant value for logOdds.

    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,logOdds)).

    LogEvidenceRatio(Bernoulli)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Bernoulli sample)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    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,logOdds) / sum_sample p(sample) messageTo(sample)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    LogEvidenceRatio(Boolean, Gaussian)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(bool sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Gaussian logOdds

    Incoming message from logOdds.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Boolean, Double)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(bool sample, double logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double logOdds

    Constant value for logOdds.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogOddsAverageConditional(Bernoulli, Gaussian)

    EP message to logOdds.

    Declaration
    public static Gaussian LogOddsAverageConditional(Bernoulli sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Gaussian logOdds

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

    Returns
    Type Description
    Gaussian

    The outgoing EP message to the logOdds argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    LogOddsAverageConditional(Boolean, Gaussian)

    EP message to logOdds.

    Declaration
    public static Gaussian LogOddsAverageConditional(bool sample, Gaussian logOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Gaussian logOdds

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

    Returns
    Type Description
    Gaussian

    The outgoing EP message to the logOdds argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    LogOddsAverageLogarithm(Bernoulli, Gaussian, Gaussian)

    Gradient matching VMP message from factor to logOdds variable

    Declaration
    public static Gaussian LogOddsAverageLogarithm(Bernoulli sample, Gaussian logOdds, Gaussian result)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from 'sample'.

    Gaussian logOdds

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

    Gaussian result

    Previous message sent, used for damping

    Returns
    Type Description
    Gaussian

    The outgoing VMP message.

    Remarks

    The outgoing message is the Gaussian approximation to the factor which results in the same derivatives of the KL(q||p) divergence with respect to the parameters of the posterior as if the true factor had been used.

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution

    LogOddsAverageLogarithm(Boolean, Gaussian, Gaussian)

    Gradient matching VMP message from factor to logOdds variable

    Declaration
    public static Gaussian LogOddsAverageLogarithm(bool sample, Gaussian logOdds, Gaussian to_LogOdds)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for 'sample'.

    Gaussian logOdds

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

    Gaussian to_LogOdds

    Previous message sent, used for damping

    Returns
    Type Description
    Gaussian

    The outgoing VMP message.

    Remarks

    The outgoing message is the Gaussian approximation to the factor which results in the same derivatives of the KL(q||p) divergence with respect to the parameters of the posterior as if the true factor had been used.

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution

    SampleAverageConditional(Gaussian)

    EP message to sample.

    Declaration
    public static Bernoulli SampleAverageConditional(Gaussian logOdds)
    Parameters
    Type Name Description
    Gaussian logOdds

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

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the sample argument.

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

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    SampleAverageLogarithm(Gaussian)

    VMP message to sample.

    Declaration
    public static Bernoulli SampleAverageLogarithm(Gaussian logOdds)
    Parameters
    Type Name Description
    Gaussian logOdds

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

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the sample argument.

    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_(logOdds) p(logOdds) log(factor(sample,logOdds))).

    Exceptions
    Type Condition
    ImproperMessageException

    logOdds is not a proper distribution.

    SampleAverageLogarithm(Double)

    VMP message to sample.

    Declaration
    public static Bernoulli SampleAverageLogarithm(double logOdds)
    Parameters
    Type Name Description
    Double logOdds

    Constant value for logOdds.

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the sample argument.

    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.