Search Results for

    Show / Hide Table of Contents

    Class SoftmaxOp_KM11

    Provides outgoing messages for Softmax(IList<Double>), given random arguments to the function.

    Inheritance
    Object
    SoftmaxOp_KM11
    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(MMath), "Softmax", new Type[]{typeof(IList<double>)}, Default = true)]
    [Quality(QualityBand.Preview)]
    [Buffers(new string[]{"A", "history"})]
    public static class SoftmaxOp_KM11
    Remarks

    This implementation uses the bound from Knowles and Minka (2011), followed by nonconjugate VMP. This approach is linear in the dimension K.

    Fields

    useBounds

    Declaration
    public static bool useBounds
    Field Value
    Type Description
    Boolean

    Methods

    A(IList<Gaussian>, Vector)

    Update the buffer A.

    Declaration
    public static Vector A(IList<Gaussian> x, Vector a)
    Parameters
    Type Name Description
    IList<Gaussian> x

    Incoming message from x. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Vector a

    Buffer a.

    Returns
    Type Description
    Vector

    New value of buffer A.

    Remarks

    Exceptions
    Type Condition
    ImproperMessageException

    x is not a proper distribution.

    AInit(IList<Gaussian>)

    Initialize the buffer A.

    Declaration
    public static Vector AInit(IList<Gaussian> x)
    Parameters
    Type Name Description
    IList<Gaussian> x

    Incoming message from x.

    Returns
    Type Description
    Vector

    Initial value of buffer A.

    Remarks

    AverageLogFactor<GaussianList>(GaussianList, Vector, Dirichlet, Dirichlet)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor<GaussianList>(GaussianList x, Vector a, Dirichlet softmax, Dirichlet to_softmax)
        where GaussianList : IList<Gaussian>
    Parameters
    Type Name Description
    GaussianList x

    Incoming message from x.

    Vector a

    Buffer a.

    Dirichlet softmax

    Incoming message from softmax.

    Dirichlet to_softmax

    Previous outgoing message to softmax.

    Returns
    Type Description
    Double

    Zero.

    Type Parameters
    Name Description
    GaussianList

    The type of the incoming message from x.

    Remarks

    In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    History(IList<Gaussian>, List<IList<Gaussian>>)

    Update the buffer history.

    Declaration
    public static List<IList<Gaussian>> History(IList<Gaussian> x, List<IList<Gaussian>> history)
    Parameters
    Type Name Description
    IList<Gaussian> x

    Incoming message from x. Must be a proper distribution. If any element is uniform, the result will be uniform.

    List<IList<Gaussian>> history

    Buffer history.

    Returns
    Type Description
    List<IList<Gaussian>>

    New value of buffer history.

    Remarks

    Exceptions
    Type Condition
    ImproperMessageException

    x is not a proper distribution.

    HistoryInit()

    Initialize the buffer history.

    Declaration
    public static List<IList<Gaussian>> HistoryInit()
    Returns
    Type Description
    List<IList<Gaussian>>

    Initial value of buffer history.

    Remarks

    SoftmaxAverageLogarithm<GaussianList>(GaussianList, Vector, Dirichlet)

    VMP message to softmax.

    Declaration
    public static Dirichlet SoftmaxAverageLogarithm<GaussianList>([SkipIfAllUniform] GaussianList x, Vector a, Dirichlet result)
        where GaussianList : IList<Gaussian>
    Parameters
    Type Name Description
    GaussianList x

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

    Vector a

    Buffer a.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Type Parameters
    Name Description
    GaussianList

    The type of the incoming message from x.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    x is not a proper distribution.

    SoftmaxAverageLogarithmInit(IList<Gaussian>)

    Declaration
    public static Dirichlet SoftmaxAverageLogarithmInit(IList<Gaussian> x)
    Parameters
    Type Name Description
    IList<Gaussian> x

    Incoming message from x.

    Returns
    Type Description
    Dirichlet
    Remarks

    XAverageLogarithm<GaussianList>(Dirichlet, IList<Gaussian>, GaussianList, Vector)

    VMP message to x.

    Declaration
    public static GaussianList XAverageLogarithm<GaussianList>(Dirichlet softmax, IList<Gaussian> x, GaussianList to_x, Vector a)
        where GaussianList : IList<Gaussian>
    Parameters
    Type Name Description
    Dirichlet softmax

    Incoming message from softmax. Must be a proper distribution. If any element is uniform, the result will be uniform.

    IList<Gaussian> x

    Incoming message from x.

    GaussianList to_x

    Previous outgoing message to x.

    Vector a

    Buffer a.

    Returns
    Type Description
    GaussianList

    The outgoing VMP message to the x argument.

    Type Parameters
    Name Description
    GaussianList

    The type of the outgoing message.

    Remarks

    The outgoing message is the factor viewed as a function of x with softmax integrated out. The formula is sum_softmax p(softmax) factor(softmax,x).

    Exceptions
    Type Condition
    ImproperMessageException

    softmax is not a proper distribution.

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