Class SoftmaxOp_KM11_Sparse2
Provides outgoing messages for Softmax(IList<Double>), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(MMath), "Softmax", new Type[]{typeof(IList<double>)})]
[Quality(QualityBand.Preview)]
[Buffers(new string[]{"Asj", "Abouchard"})]
public static class SoftmaxOp_KM11_Sparse2
Remarks
This implementation uses a generalization of the tilted bound used in Saul Jordan 1999, followed by nonconjugate VMP. This approach is linear in the dimension K.
Methods
Abouchard<GaussianList>(GaussianList, Double)
Update the buffer Abouchard
.
Declaration
public static double Abouchard<GaussianList>(GaussianList x, double abouchard)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
GaussianList | x | Incoming message from |
Double | abouchard | Buffer |
Returns
Type | Description |
---|---|
Double | New value of buffer |
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the incoming message from |
Remarks
AbouchardInit()
Initialize the buffer Abouchard
.
Declaration
public static double AbouchardInit()
Returns
Type | Description |
---|---|
Double | Initial value of buffer |
Remarks
Asj(IList<Gaussian>, IList<Double>)
Update the buffer Asj
.
Declaration
public static IList<double> Asj(IList<Gaussian> x, IList<double> asj)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | x | Incoming message from |
IList<Double> | asj | Buffer |
Returns
Type | Description |
---|---|
IList<Double> | New value of buffer |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AsjInit(IList<Gaussian>)
Initialize the buffer Asj
.
Declaration
public static IList<double> AsjInit(IList<Gaussian> x)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | x | Incoming message from |
Returns
Type | Description |
---|---|
IList<Double> | Initial value of buffer |
Remarks
LogAverageFactor<GaussianList>(GaussianList, IList<Double>, Double, Dirichlet, Dirichlet)
Evidence message for EP.
Declaration
public static double LogAverageFactor<GaussianList>([SkipIfAllUniform] GaussianList x, IList<double> asj, double abouchard, Dirichlet softmax, Dirichlet to_softmax)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
GaussianList | x | Incoming message from |
IList<Double> | asj | Buffer |
Double | abouchard | Buffer |
Dirichlet | softmax | Incoming message from |
Dirichlet | to_softmax | Previous outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the incoming message from |
Remarks
The formula for the result is log(sum_(x,softmax) p(x,softmax) factor(softmax,x))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SoftmaxAverageLogarithm<GaussianList>(GaussianList, IList<Double>, Double, Dirichlet, Dirichlet)
VMP message to softmax
.
Declaration
public static Dirichlet SoftmaxAverageLogarithm<GaussianList>([SkipIfAllUniform] GaussianList x, IList<double> asj, double abouchard, Dirichlet softmax, Dirichlet to_softmax)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
GaussianList | x | Incoming message from |
IList<Double> | asj | Buffer |
Double | abouchard | Buffer |
Dirichlet | softmax | Incoming message from |
Dirichlet | to_softmax | Previous outgoing message to |
Returns
Type | Description |
---|---|
Dirichlet | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the incoming message from |
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 |
|
XAverageLogarithm<GaussianList>(GaussianList, IList<Double>, Double, Dirichlet, Dirichlet, GaussianList)
VMP message to x
.
Declaration
public static GaussianList XAverageLogarithm<GaussianList>([SkipIfAllUniform] GaussianList x, IList<double> asj, double abouchard, Dirichlet softmax, Dirichlet to_softmax, GaussianList to_x)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
GaussianList | x | Incoming message from |
IList<Double> | asj | Buffer |
Double | abouchard | Buffer |
Dirichlet | softmax | Incoming message from |
Dirichlet | to_softmax | Previous outgoing message to |
GaussianList | to_x | Previous outgoing message to |
Returns
Type | Description |
---|---|
GaussianList | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the incoming message from |
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 |
|