Search Results for

    Show / Hide Table of Contents

    Class UnaryOp<DomainType>

    Provides outgoing messages for Random<DomainType>(Sampleable<DomainType>), given random arguments to the function.

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

    The type of the sampled variable.

    Methods

    AverageLogFactor<T>(T, T)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor<T>(T random, T dist)
        where T : CanGetAverageLog<T>
    Parameters
    Type Name Description
    T random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    AverageLogFactor<T>(DomainType, T)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor<T>(DomainType random, T dist)
        where T : CanGetLogProb<DomainType>
    Parameters
    Type Name Description
    DomainType random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    LogAverageFactor<T>(T, T)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<T>(T random, T dist)
        where T : CanGetLogAverageOf<T>
    Parameters
    Type Name Description
    T random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

    The formula for the result is log(sum_(random,dist) p(random,dist) factor(random,dist)).

    LogAverageFactor<T>(DomainType, T)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<T>(DomainType random, T dist)
        where T : CanGetLogProb<DomainType>
    Parameters
    Type Name Description
    DomainType random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

    The formula for the result is log(sum_(random,dist) p(random,dist) factor(random,dist)).

    LogEvidenceRatio<T>(T, T)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<T>(T random, T dist)
    Parameters
    Type Name Description
    T random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    LogEvidenceRatio<T>(DomainType, T)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<T>(DomainType random, T dist)
        where T : CanGetLogProb<DomainType>
    Parameters
    Type Name Description
    DomainType random

    Incoming message from random.

    T dist

    Incoming message from dist.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    RandomAverageConditional<T>(T)

    EP message to random.

    Declaration
    public static T RandomAverageConditional<T>(T dist)
    Parameters
    Type Name Description
    T dist

    Incoming message from dist.

    Returns
    Type Description
    T

    The outgoing EP message to the random argument.

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    RandomAverageLogarithm<T>(T)

    VMP message to random.

    Declaration
    public static T RandomAverageLogarithm<T>(T dist)
    Parameters
    Type Name Description
    T dist

    Incoming message from dist.

    Returns
    Type Description
    T

    The outgoing VMP message to the random argument.

    Type Parameters
    Name Description
    T

    The type of the distribution over the sampled variable.

    Remarks

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

    RandomMaxConditional(Bernoulli)

    Declaration
    public static Bernoulli RandomMaxConditional(Bernoulli dist)
    Parameters
    Type Name Description
    Bernoulli dist

    Incoming message from dist.

    Returns
    Type Description
    Bernoulli
    Remarks

    RandomMaxConditional(Discrete)

    Declaration
    public static UnnormalizedDiscrete RandomMaxConditional(Discrete dist)
    Parameters
    Type Name Description
    Discrete dist

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

    Returns
    Type Description
    UnnormalizedDiscrete
    Remarks

    Exceptions
    Type Condition
    ImproperMessageException

    dist is not a proper distribution.

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