Class LogisticOp
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)})]
[Quality(QualityBand.Stable)]
[Buffers(new string[]{"falseMsg"})]
public class LogisticOp
Methods
AverageLogFactor(Gaussian, Beta, Beta)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Gaussian x, Beta logistic, Beta to_logistic)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
Beta | logistic | Incoming message from |
Beta | to_logistic | Previous outgoing message to |
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 |
|
AverageLogFactor(Double, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(double logistic, double x)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(logistic,x))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
FalseMsg(Beta, Gaussian, Gaussian)
Update the buffer falseMsg
.
Declaration
public static Gaussian FalseMsg(Beta logistic, Gaussian x, Gaussian falseMsg)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | falseMsg | Buffer |
Returns
Type | Description |
---|---|
Gaussian | New value of buffer |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
FalseMsgInit()
Initialize the buffer falseMsg
.
Declaration
public static Gaussian FalseMsgInit()
Returns
Type | Description |
---|---|
Gaussian | Initial value of buffer |
Remarks
LogAverageFactor(Beta, Gaussian, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Beta logistic, Gaussian x, Gaussian falseMsg)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | falseMsg | Buffer |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(logistic,x) p(logistic,x) factor(logistic,x))
.
LogAverageFactor(Beta, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Beta logistic, double x)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(logistic) p(logistic) factor(logistic,x))
.
LogAverageFactor(Double, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double logistic, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(sum_(x) p(x) factor(logistic,x))
.
LogAverageFactor(Double, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double logistic, double x)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Remarks
The formula for the result is log(factor(logistic,x))
.
LogEvidenceRatio(Beta, Gaussian, Gaussian, Beta)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Beta logistic, Gaussian x, Gaussian falseMsg, Beta to_logistic)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | falseMsg | Buffer |
Beta | to_logistic | Outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(logistic,x) p(logistic,x) factor(logistic,x) / sum_logistic p(logistic) messageTo(logistic))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double logistic, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(x) p(x) factor(logistic,x))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, Double)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double logistic, double x)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(factor(logistic,x))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogisticAverageConditional(Beta, Gaussian, Gaussian, Gaussian)
EP message to logistic
.
Declaration
public static Beta LogisticAverageConditional(Beta logistic, Gaussian x, Gaussian falseMsg, Gaussian to_x)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | falseMsg | Buffer |
Gaussian | to_x | Previous outgoing message to |
Returns
Type | Description |
---|---|
Beta | The outgoing EP 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[p(logistic) sum_(x) p(x) factor(logistic,x)]/p(logistic)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogisticAverageConditionalInit()
Declaration
public static Beta LogisticAverageConditionalInit()
Returns
Type | Description |
---|---|
Beta |
Remarks
LogisticAverageLogarithm(Gaussian)
VMP message to logistic
.
Declaration
public static Beta LogisticAverageLogarithm(Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
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 |
|
XAverageConditional(Beta, Gaussian)
EP message to x
.
Declaration
public static Gaussian XAverageConditional(Beta logistic, Gaussian falseMsg)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | falseMsg | Buffer |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of x
as the random arguments are varied. The formula is proj[p(x) sum_(logistic) p(logistic) factor(logistic,x)]/p(x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
XAverageConditional(Double)
EP message to x
.
Declaration
public static Gaussian XAverageConditional(double logistic)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.
XAverageLogarithm(Beta, Gaussian, Gaussian)
VMP message to x
.
Declaration
public static Gaussian XAverageLogarithm(Beta logistic, Gaussian x, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Beta | logistic | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | to_X | Previous outgoing message to |
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 |
|
ImproperMessageException |
|
XAverageLogarithm(Double)
VMP message to x
.
Declaration
public static Gaussian XAverageLogarithm(double logistic)
Parameters
Type | Name | Description |
---|---|---|
Double | logistic | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.