Search Results for

    Show / Hide Table of Contents

    Class ReplicateOp

    Provides outgoing messages for the following factors:

    • Replicate<T>(T, Int32)
    • ReplicateWithMarginal<T>(T, Int32, out T)
    , given random arguments to the function.

    Inheritance
    Object
    ReplicateOp
    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(Clone), "Replicate<>", new Type[]{}, Default = true)]
    [FactorMethod(typeof(Clone), "ReplicateWithMarginal<>", new Type[]{}, Default = true)]
    [Quality(QualityBand.Mature)]
    public static class ReplicateOp

    Methods

    AverageLogFactor()

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor()
    Returns
    Type Description
    Double

    Zero.

    Remarks

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

    DefAverageLogarithm<T>(T[], T)

    VMP message to Def.

    Declaration
    public static T DefAverageLogarithm<T>([SkipIfAllUniform] T[] Uses, T result)
        where T : SettableToProduct<T>, SettableTo<T>, SettableToUniform
    Parameters
    Type Name Description
    T[] Uses

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

    T result

    Modified to contain the outgoing message.

    Returns
    Type Description
    T

    result

    Type Parameters
    Name Description
    T

    The type of the messages.

    Remarks

    The outgoing message is the factor viewed as a function of Def with Uses integrated out. The formula is sum_Uses p(Uses) factor(Uses,Def,Count).

    Exceptions
    Type Condition
    ImproperMessageException

    Uses is not a proper distribution.

    DefAverageLogarithm<T>(IReadOnlyList<T>, T)

    Declaration
    public static T DefAverageLogarithm<T>([SkipIfAllUniform] IReadOnlyList<T> Uses, T result)
        where T : SettableToProduct<T>, SettableTo<T>, SettableToUniform
    Parameters
    Type Name Description
    IReadOnlyList<T> Uses
    T result
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    The type of the messages.

    LogAverageFactor()

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor()
    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(Uses,Def,Count)).

    LogEvidenceRatio<T>(IList<T>, T, IList<T>)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio<T>([SkipIfAllUniform] IList<T> Uses, T Def, IList<T> to_Uses)
        where T : CanGetLogAverageOf<T>, SettableToProduct<T>, SettableTo<T>, ICloneable, SettableToUniform
    Parameters
    Type Name Description
    IList<T> Uses

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

    T Def

    Incoming message from Def.

    IList<T> to_Uses

    Outgoing message to Uses.

    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 replicated variable.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    Uses is not a proper distribution.

    MarginalAverageLogarithm<T, TDef>(TDef, T)

    Declaration
    public static T MarginalAverageLogarithm<T, TDef>([SkipIfAllUniform] TDef Def, T result)
        where T : SettableTo<TDef>
    Parameters
    Type Name Description
    TDef Def

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

    T result

    Modified to contain the outgoing message.

    Returns
    Type Description
    T

    result

    Type Parameters
    Name Description
    T

    The type of the outgoing message.

    TDef

    The type of the incoming message from Def.

    Remarks

    Exceptions
    Type Condition
    ImproperMessageException

    Def is not a proper distribution.

    UsesAverageLogarithm<T, TDef>(TDef, Int32, T)

    VMP message to Uses.

    Declaration
    public static T UsesAverageLogarithm<T, TDef>(TDef Def, int resultIndex, T result)
        where T : SettableTo<TDef>
    Parameters
    Type Name Description
    TDef Def

    Incoming message from Def.

    Int32 resultIndex

    Index of the Uses for which a message is desired.

    T result

    Modified to contain the outgoing message.

    Returns
    Type Description
    T

    result

    Type Parameters
    Name Description
    T

    The type of the outgoing message.

    TDef

    The type of the incoming message from Def.

    Remarks

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

    UsesAverageLogarithm2<T, TDef>(TDef, T)

    Declaration
    public static T UsesAverageLogarithm2<T, TDef>(TDef Def, T result)
        where T : CanSetAllElementsTo<TDef>
    Parameters
    Type Name Description
    TDef Def
    T result
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    TDef

    UsesDeriv<T>(T)

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

    UsesDeriv<T>(T[])

    Declaration
    public static T[] UsesDeriv<T>(T[] result)
        where T : SettableToUniform
    Parameters
    Type Name Description
    T[] result
    Returns
    Type Description
    T[]
    Type Parameters
    Name Description
    T

    UsesInit<T, ArrayType>(T, Int32, IArrayFactory<T, ArrayType>)

    Initialize the buffer Uses.

    Declaration
    public static ArrayType UsesInit<T, ArrayType>(T Def, int count, IArrayFactory<T, ArrayType> factory)
        where T : ICloneable
    Parameters
    Type Name Description
    T Def

    Incoming message from Def.

    Int32 count

    Constant value for Count.

    IArrayFactory<T, ArrayType> factory
    Returns
    Type Description
    ArrayType

    Initial value of buffer Uses.

    Type Parameters
    Name Description
    T

    The type of the incoming message from Def.

    ArrayType

    The type of arrays produced by factory.

    Remarks

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