Search Results for

    Show / Hide Table of Contents

    Class SubarrayOp<T>

    Provides outgoing messages for Subarray<T>(IReadOnlyList<T>, IReadOnlyList<Int32>), given random arguments to the function.

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

    The type of an array item.

    Methods

    ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<DistributionType>, IReadOnlyList<Int32>, ArrayType)

    EP message to array.

    Declaration
    public static ArrayType ArrayAverageConditional<DistributionType, ArrayType>([SkipIfAllUniform] IReadOnlyList<DistributionType> items, IReadOnlyList<int> indices, ArrayType result)
        where DistributionType : SettableTo<DistributionType> where ArrayType : IList<DistributionType>, SettableToUniform
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> items

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

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ArrayType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ArrayType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ArrayType

    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_(items) p(items) factor(items,array,indices)]/p(array).

    Exceptions
    Type Condition
    ImproperMessageException

    items is not a proper distribution.

    ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<T>, IReadOnlyList<Int32>, ArrayType)

    EP message to array.

    Declaration
    public static ArrayType ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<T> items, IReadOnlyList<int> indices, ArrayType result)
        where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ArrayType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ArrayType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ArrayType

    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_(items) p(items) factor(items,array,indices)]/p(array).

    ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<DistributionType>, IReadOnlyList<Int32>, ArrayType)

    VMP message to array.

    Declaration
    public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType>([SkipIfAllUniform] IReadOnlyList<DistributionType> items, IReadOnlyList<int> indices, ArrayType result)
        where DistributionType : SettableTo<DistributionType> where ArrayType : IList<DistributionType>, SettableToUniform
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> items

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

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ArrayType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ArrayType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ArrayType

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of array with items integrated out. The formula is sum_items p(items) factor(items,array,indices).

    Exceptions
    Type Condition
    ImproperMessageException

    items is not a proper distribution.

    ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<T>, IReadOnlyList<Int32>, ArrayType)

    VMP message to array.

    Declaration
    public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<T> items, IReadOnlyList<int> indices, ArrayType result)
        where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ArrayType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ArrayType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ArrayType

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of array with items integrated out. The formula is sum_items p(items) factor(items,array,indices).

    AverageLogFactor()

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor()
    Returns
    Type Description
    Double

    Zero.

    Remarks

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

    ItemsAverageConditional<DistributionType, ResultType>(IReadOnlyList<DistributionType>, IReadOnlyList<Int32>, ResultType)

    EP message to items.

    Declaration
    public static ResultType ItemsAverageConditional<DistributionType, ResultType>([SkipIfAllUniform] IReadOnlyList<DistributionType> array, IReadOnlyList<int> indices, ResultType result)
        where DistributionType : SettableTo<DistributionType> where ResultType : IList<DistributionType>
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> array

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

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ResultType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ResultType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ResultType

    The type of the outgoing message.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    array is not a proper distribution.

    ItemsAverageConditionalInit<TDist>(DistributionRefArray<TDist, T>, IReadOnlyList<Int32>)

    Declaration
    public static DistributionRefArray<TDist, T> ItemsAverageConditionalInit<TDist>(DistributionRefArray<TDist, T> array, IReadOnlyList<int> indices)
        where TDist : class, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToPower<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>, CanGetLogAverageOfPower<TDist>, CanGetAverageLog<TDist>, IDistribution<T>, Sampleable<T>
    Parameters
    Type Name Description
    DistributionRefArray<TDist, T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    DistributionRefArray<TDist, T>
    Type Parameters
    Name Description
    TDist

    The type of a distribution over an array item.

    Remarks

    ItemsAverageConditionalInit<TDist>(DistributionStructArray<TDist, T>, IReadOnlyList<Int32>)

    Declaration
    public static DistributionStructArray<TDist, T> ItemsAverageConditionalInit<TDist>(DistributionStructArray<TDist, T> array, IReadOnlyList<int> indices)
        where TDist : struct, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToPower<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>, CanGetLogAverageOfPower<TDist>, CanGetAverageLog<TDist>, IDistribution<T>, Sampleable<T>
    Parameters
    Type Name Description
    DistributionStructArray<TDist, T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    DistributionStructArray<TDist, T>
    Type Parameters
    Name Description
    TDist

    The type of a distribution over an array item.

    Remarks

    ItemsAverageLogarithm<DistributionType, ResultType>(IReadOnlyList<DistributionType>, IReadOnlyList<Int32>, ResultType)

    VMP message to items.

    Declaration
    public static ResultType ItemsAverageLogarithm<DistributionType, ResultType>([SkipIfAllUniform] IReadOnlyList<DistributionType> array, IReadOnlyList<int> indices, ResultType result)
        where DistributionType : SettableTo<DistributionType> where ResultType : IList<DistributionType>
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> array

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

    IReadOnlyList<Int32> indices

    Constant value for indices.

    ResultType result

    Modified to contain the outgoing message.

    Returns
    Type Description
    ResultType

    result

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    ResultType

    The type of the outgoing message.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    array is not a proper distribution.

    ItemsAverageLogarithmInit<TDist>(DistributionRefArray<TDist, T>, IReadOnlyList<Int32>)

    Declaration
    public static DistributionRefArray<TDist, T> ItemsAverageLogarithmInit<TDist>(DistributionRefArray<TDist, T> array, IReadOnlyList<int> indices)
        where TDist : class, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToPower<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>, CanGetLogAverageOfPower<TDist>, CanGetAverageLog<TDist>, IDistribution<T>, Sampleable<T>
    Parameters
    Type Name Description
    DistributionRefArray<TDist, T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    DistributionRefArray<TDist, T>
    Type Parameters
    Name Description
    TDist

    The type of a distribution over an array item.

    Remarks

    ItemsAverageLogarithmInit<TDist>(DistributionStructArray<TDist, T>, IReadOnlyList<Int32>)

    Declaration
    public static DistributionStructArray<TDist, T> ItemsAverageLogarithmInit<TDist>(DistributionStructArray<TDist, T> array, IReadOnlyList<int> indices)
        where TDist : struct, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToPower<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>, CanGetLogAverageOfPower<TDist>, CanGetAverageLog<TDist>, IDistribution<T>, Sampleable<T>
    Parameters
    Type Name Description
    DistributionStructArray<TDist, T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    DistributionStructArray<TDist, T>
    Type Parameters
    Name Description
    TDist

    The type of a distribution over an array item.

    Remarks

    ItemsDeriv<ResultType>(ResultType)

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

    LogAverageFactor(IReadOnlyList<T>, IReadOnlyList<T>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(IReadOnlyList<T> items, IReadOnlyList<T> array, IReadOnlyList<int> indices)
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    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_(items,array) p(items,array) factor(items,array,indices)).

    LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType>, IReadOnlyList<DistributionType>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType> items, IReadOnlyList<DistributionType> array, IReadOnlyList<int> indices)
        where DistributionType : CanGetLogAverageOf<DistributionType>
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> items

    Incoming message from items.

    IReadOnlyList<DistributionType> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    Remarks

    The formula for the result is log(sum_(items,array) p(items,array) factor(items,array,indices)).

    LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType>, IReadOnlyList<T>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType> items, IReadOnlyList<T> array, IReadOnlyList<int> indices)
        where DistributionType : CanGetLogProb<T>
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> items

    Incoming message from items.

    IReadOnlyList<T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    Remarks

    The formula for the result is log(sum_(items,array) p(items,array) factor(items,array,indices)).

    LogAverageFactor<DistributionType>(IReadOnlyList<T>, IReadOnlyList<DistributionType>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor<DistributionType>(IReadOnlyList<T> items, IReadOnlyList<DistributionType> array, IReadOnlyList<int> indices)
        where DistributionType : CanGetLogProb<T>
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<DistributionType> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    Remarks

    The formula for the result is log(sum_(items,array) p(items,array) factor(items,array,indices)).

    LogEvidenceRatio(IReadOnlyList<T>, IReadOnlyList<T>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(IReadOnlyList<T> items, IReadOnlyList<T> array, IReadOnlyList<int> indices)
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<T> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio<DistributionType>(IReadOnlyList<DistributionType>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<DistributionType>(IReadOnlyList<DistributionType> items)
        where DistributionType : CanGetLogAverageOf<DistributionType>
    Parameters
    Type Name Description
    IReadOnlyList<DistributionType> items

    Incoming message from items.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    Remarks

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

    LogEvidenceRatio<DistributionType>(IReadOnlyList<T>, IReadOnlyList<DistributionType>, IReadOnlyList<Int32>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<DistributionType>(IReadOnlyList<T> items, IReadOnlyList<DistributionType> array, IReadOnlyList<int> indices)
        where DistributionType : CanGetLogProb<T>
    Parameters
    Type Name Description
    IReadOnlyList<T> items

    Incoming message from items.

    IReadOnlyList<DistributionType> array

    Incoming message from array.

    IReadOnlyList<Int32> indices

    Constant value for indices.

    Returns
    Type Description
    Double

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

    Type Parameters
    Name Description
    DistributionType

    The type of a distribution over an array item.

    Remarks

    The formula for the result is log(sum_(items,array) p(items,array) factor(items,array,indices) / sum_items p(items) messageTo(items)). 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.