Class GammaSoftmaxOp
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.Experimental)]
public static class GammaSoftmaxOp
Remarks
Here the marginal prototype for logOdds is Gamma, which allows for heavier tailed distributions. This implementation uses the Taylor series bound from Blei 06, followed by optimization using LBFGS. This approach is linear in the dimension K.
Methods
GetMeanLog(IList<Gamma>)
Declaration
public static Vector GetMeanLog(IList<Gamma> x)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Gamma> | x | Incoming message from 'x'. |
Returns
| Type | Description |
|---|---|
| Vector |
Remarks
SoftmaxAverageLogarithm(IList<Gamma>)
VMP message to softmax.
Declaration
public static Dirichlet SoftmaxAverageLogarithm([SkipIfAllUniform] IList<Gamma> x)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Gamma> | x | Incoming message from |
Returns
| Type | Description |
|---|---|
| Dirichlet | The outgoing VMP message to the |
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<GammaList>(Dirichlet, GammaList, GammaList)
VMP message to x.
Declaration
public static GammaList XAverageLogarithm<GammaList>(Dirichlet softmax, [SkipIfAllUniform] GammaList x, GammaList result)
where GammaList : IList<Gamma>
Parameters
| Type | Name | Description |
|---|---|---|
| Dirichlet | softmax | Incoming message from |
| GammaList | x | Incoming message from |
| GammaList | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| GammaList |
|
Type Parameters
| Name | Description |
|---|---|
| GammaList | 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 |
|
| ImproperMessageException |
|