Search Results for

    Show / Hide Table of Contents

    Class GetItem2DOp<T>

    Provides outgoing messages for GetItem2D<T>(T[,], Int32, Int32), given random arguments to the function.

    Inheritance
    Object
    GetItem2DOp<T>
    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(Collection), "GetItem2D<>", new Type[]{})]
    [Quality(QualityBand.Stable)]
    public static class GetItem2DOp<T>
    Type Parameters
    Name Description
    T

    The type of an item.

    Methods

    ArrayAverageConditional<Distribution, DistributionArray>(Distribution, Int32, Int32, DistributionArray)

    EP message to array.

    Declaration
    public static DistributionArray ArrayAverageConditional<Distribution, DistributionArray>(Distribution item, int index1, int index2, DistributionArray result)
        where Distribution : SettableTo<Distribution> where DistributionArray : IArray2D<Distribution>
    Parameters
    Type Name Description
    Distribution item

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

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    DistributionArray result

    Modified to contain the outgoing message.

    Returns
    Type Description
    DistributionArray

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    DistributionArray

    The type of the outgoing message.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    item is not a proper distribution.

    ArrayAverageConditional<Distribution, DistributionArray>(T, Int32, Int32, DistributionArray)

    EP message to array.

    Declaration
    public static DistributionArray ArrayAverageConditional<Distribution, DistributionArray>(T item, int index1, int index2, DistributionArray result)
        where Distribution : HasPoint<T> where DistributionArray : IArray2D<Distribution>
    Parameters
    Type Name Description
    T item

    Incoming message from item.

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    DistributionArray result

    Modified to contain the outgoing message.

    Returns
    Type Description
    DistributionArray

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    DistributionArray

    The type of the outgoing message.

    Remarks

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

    ArrayAverageLogarithm<Distribution, DistributionArray>(Distribution, Int32, Int32, DistributionArray)

    VMP message to array.

    Declaration
    public static DistributionArray ArrayAverageLogarithm<Distribution, DistributionArray>(Distribution item, int index1, int index2, DistributionArray result)
        where Distribution : SettableTo<Distribution> where DistributionArray : IArray2D<Distribution>
    Parameters
    Type Name Description
    Distribution item

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

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    DistributionArray result

    Modified to contain the outgoing message.

    Returns
    Type Description
    DistributionArray

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    DistributionArray

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of array with item integrated out. The formula is sum_item p(item) factor(item,array,index1,index2).

    Exceptions
    Type Condition
    ImproperMessageException

    item is not a proper distribution.

    ArrayAverageLogarithm<Distribution, DistributionArray>(T, Int32, Int32, DistributionArray)

    VMP message to array.

    Declaration
    public static DistributionArray ArrayAverageLogarithm<Distribution, DistributionArray>(T item, int index1, int index2, DistributionArray result)
        where Distribution : HasPoint<T> where DistributionArray : IArray2D<Distribution>
    Parameters
    Type Name Description
    T item

    Incoming message from item.

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    DistributionArray result

    Modified to contain the outgoing message.

    Returns
    Type Description
    DistributionArray

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    DistributionArray

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of array with item integrated out. The formula is sum_item p(item) factor(item,array,index1,index2).

    AverageLogFactor()

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor()
    Returns
    Type Description
    Double

    Zero.

    Remarks

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

    ItemAverageConditional<Distribution>(IArray2D<Distribution>, Int32, Int32, Distribution)

    EP message to item.

    Declaration
    public static Distribution ItemAverageConditional<Distribution>([SkipIfAllUniform] IArray2D<Distribution> array, int index1, int index2, Distribution result)
        where Distribution : SettableTo<Distribution>
    Parameters
    Type Name Description
    IArray2D<Distribution> array

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

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    Distribution result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Distribution

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    array is not a proper distribution.

    ItemAverageLogarithm<Distribution>(IArray2D<Distribution>, Int32, Int32, Distribution)

    VMP message to item.

    Declaration
    public static Distribution ItemAverageLogarithm<Distribution>([SkipIfAllUniform] IArray2D<Distribution> array, int index1, int index2, Distribution result)
        where Distribution : SettableTo<Distribution>
    Parameters
    Type Name Description
    IArray2D<Distribution> array

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

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    Distribution result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Distribution

    result

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    array is not a proper distribution.

    LogAverageFactor<Distribution>(Distribution, Distribution)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<Distribution>(Distribution item, Distribution to_item)
        where Distribution : CanGetLogAverageOf<Distribution>
    Parameters
    Type Name Description
    Distribution item

    Incoming message from item.

    Distribution to_item

    Outgoing message to item.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

    The formula for the result is log(sum_(item) p(item) factor(item,array,index1,index2)).

    LogAverageFactor<Distribution>(T, IArray2D<Distribution>, Int32, Int32)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<Distribution>(T item, IArray2D<Distribution> array, int index1, int index2)
        where Distribution : CanGetLogProb<T>
    Parameters
    Type Name Description
    T item

    Incoming message from item.

    IArray2D<Distribution> array

    Incoming message from array.

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

    The formula for the result is log(sum_(item,array) p(item,array) factor(item,array,index1,index2)).

    LogEvidenceRatio<Distribution>(Distribution)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<Distribution>(Distribution item)
    Parameters
    Type Name Description
    Distribution item

    Incoming message from item.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

    The formula for the result is log(sum_(item) p(item) factor(item,array,index1,index2) / sum_item p(item) messageTo(item)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    LogEvidenceRatio<Distribution>(T, IArray2D<Distribution>, Int32, Int32)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<Distribution>(T item, IArray2D<Distribution> array, int index1, int index2)
        where Distribution : CanGetLogProb<T>
    Parameters
    Type Name Description
    T item

    Incoming message from item.

    IArray2D<Distribution> array

    Incoming message from array.

    Int32 index1

    Constant value for index1.

    Int32 index2

    Constant value for index2.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    Distribution

    The type of the distribution over an item.

    Remarks

    The formula for the result is log(sum_(item,array) p(item,array) factor(item,array,index1,index2) / sum_item p(item) messageTo(item)). 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.