Class LogisticOp_SJ99
Provides outgoing messages for Logistic(Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(MMath), "Logistic", new Type[]{typeof(double)}, Default = true)]
[Quality(QualityBand.Preview)]
[Buffers(new string[]{"A"})]
public class LogisticOp_SJ99
Remarks
Uses the Saul and Jordan (1999) bound \langle log(1+exp(x)) \rangle \leq a^2*v/2 + log(1+exp(m+(1-2a)v/2))
Fields
global_step
Declaration
public static double global_step
Field Value
Type | Description |
---|---|
Double |
Methods
A(Gaussian, Double)
Update the buffer A
.
Declaration
public static double A(Gaussian x, double a)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
Double | a | Buffer |
Returns
Type | Description |
---|---|
Double | New value of buffer |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AInit()
Initialize the buffer A
.
Declaration
public static double AInit()
Returns
Type | Description |
---|---|
Double | Initial value of buffer |
Remarks
AverageLogFactor(Beta, Gaussian, Beta, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Beta logistic, Gaussian x, Beta to_logistic, double a)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Beta | to_logistic | Previous outgoing message to |
Double | a | Buffer |
Returns
Type | Description |
---|---|
Double | Zero. |
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.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogisticAverageLogarithm(Gaussian, Double)
VMP message to logistic
.
Declaration
public static Beta LogisticAverageLogarithm(Gaussian x, double a)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
Double | a | Buffer |
Returns
Type | Description |
---|---|
Beta | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of logistic
as the random arguments are varied. The formula is proj[sum_(x) p(x) factor(logistic,x)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogisticInit()
Initialize the buffer logistic
.
Declaration
public static Beta LogisticInit()
Returns
Type | Description |
---|---|
Beta | Initial value of buffer |
Remarks
logSumExpBound(Double, Double, Double)
Declaration
public static double logSumExpBound(double m, double v, double a)
Parameters
Type | Name | Description |
---|---|---|
Double | m | |
Double | v | |
Double | a |
Returns
Type | Description |
---|---|
Double |
XAverageLogarithm(Beta, Gaussian, Gaussian, Double)
VMP message to x
.
Declaration
public static Gaussian XAverageLogarithm(Beta logistic, Gaussian x, Gaussian to_x, double a)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | to_x | Previous outgoing message to |
Double | a | Buffer |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
with logistic
integrated out. The formula is sum_logistic p(logistic) factor(logistic,x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
XInit()
Initialize the buffer x
.
Declaration
public static Gaussian XInit()
Returns
Type | Description |
---|---|
Gaussian | Initial value of buffer |
Remarks