Search Results for

    Show / Hide Table of Contents

    Class VectorSoftmaxOp_KM11

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

    Inheritance
    Object
    VectorSoftmaxOp_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(Vector)})]
    [Quality(QualityBand.Preview)]
    [Buffers(new string[]{"A"})]
    public static class VectorSoftmaxOp_KM11
    Remarks

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

    Methods

    A(VectorGaussian, Vector)

    Update the buffer A.

    Declaration
    public static Vector A(VectorGaussian x, Vector a)
    Parameters
    Type Name Description
    VectorGaussian 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(VectorGaussian)

    Initialize the buffer A.

    Declaration
    public static Vector AInit(VectorGaussian x)
    Parameters
    Type Name Description
    VectorGaussian x

    Incoming message from x.

    Returns
    Type Description
    Vector

    Initial value of buffer A.

    Remarks

    AverageLogFactor()

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor()
    Returns
    Type Description
    Double

    Zero.

    Remarks

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

    SoftmaxAverageLogarithm(VectorGaussian, Vector, Dirichlet)

    VMP message to softmax.

    Declaration
    public static Dirichlet SoftmaxAverageLogarithm(VectorGaussian x, Vector a, Dirichlet result)
    Parameters
    Type Name Description
    VectorGaussian x

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

    Vector a

    Buffer a.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    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(VectorGaussian)

    Declaration
    public static Dirichlet SoftmaxAverageLogarithmInit(VectorGaussian x)
    Parameters
    Type Name Description
    VectorGaussian x

    Incoming message from x.

    Returns
    Type Description
    Dirichlet
    Remarks

    VectorGaussianToGaussianList(VectorGaussian)

    Declaration
    public static Gaussian[] VectorGaussianToGaussianList(VectorGaussian x)
    Parameters
    Type Name Description
    VectorGaussian x
    Returns
    Type Description
    Gaussian[]

    XAverageLogarithm(Dirichlet, VectorGaussian, Vector, VectorGaussian)

    VMP message to x.

    Declaration
    public static VectorGaussian XAverageLogarithm(Dirichlet softmax, VectorGaussian x, Vector a, VectorGaussian result)
    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.

    VectorGaussian x

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

    Vector a

    Buffer a.

    VectorGaussian result

    Modified to contain the outgoing message.

    Returns
    Type Description
    VectorGaussian

    result

    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.

    ImproperMessageException

    x is not a proper distribution.

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