Class ExpOp
Provides outgoing messages for Exp(Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Math), "Exp", new Type[]{typeof(double)}, Default = true)]
[Quality(QualityBand.Stable)]
public class ExpOp
Fields
ForceProper
Forces proper messages when set to true.
Declaration
public static bool ForceProper
Field Value
Type | Description |
---|---|
Boolean |
QuadratureIterations
Number of quadrature iterations
Declaration
public static int QuadratureIterations
Field Value
Type | Description |
---|---|
Int32 |
QuadratureNodeCount
The number of quadrature nodes used to compute the messages. Reduce this number to save time in exchange for less accuracy.
Declaration
public static int QuadratureNodeCount
Field Value
Type | Description |
---|---|
Int32 |
QuadratureShift
Quadrature shift
Declaration
public static bool QuadratureShift
Field Value
Type | Description |
---|---|
Boolean |
UseRandomDamping
Declaration
public static bool UseRandomDamping
Field Value
Type | Description |
---|---|
Boolean |
Methods
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(exp,d))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Double, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(double exp, double d)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | Constant value for |
Double | d | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(exp,d))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
DAverageConditional(Gamma, Gaussian, Gaussian)
EP message to d
.
Declaration
public static Gaussian DAverageConditional(Gamma exp, Gaussian d, Gaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Gaussian |
|
Remarks
The outgoing message is a distribution matching the moments of d
as the random arguments are varied. The formula is proj[p(d) sum_(exp) p(exp) factor(exp,d)]/p(d)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
DAverageConditional(GammaPower, Gaussian, Gaussian)
Declaration
public static Gaussian DAverageConditional(GammaPower exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
GammaPower | exp | |
Gaussian | d | |
Gaussian | to_d |
Returns
Type | Description |
---|---|
Gaussian |
DAverageConditional(Double)
EP message to d
.
Declaration
public static Gaussian DAverageConditional(double exp)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | 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 d
conditioned on the given values.
DAverageLogarithm(Gamma, Gaussian, Gaussian)
VMP message to d
.
Declaration
public static Gaussian DAverageLogarithm(Gamma exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | to_d | 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 d
with exp
integrated out. The formula is sum_exp p(exp) factor(exp,d)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
DAverageLogarithm(Gamma, NonconjugateGaussian, NonconjugateGaussian)
VMP message to d
.
Declaration
[Quality(QualityBand.Experimental)]
public static NonconjugateGaussian DAverageLogarithm(Gamma exp, NonconjugateGaussian d, NonconjugateGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
NonconjugateGaussian | d | Incoming message from |
NonconjugateGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
NonconjugateGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of d
with exp
integrated out. The formula is sum_exp p(exp) factor(exp,d)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
DAverageLogarithm(Double)
VMP message to d
.
Declaration
public static Gaussian DAverageLogarithm(double exp)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | 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 d
conditioned on the given values.
DNonconjugateAverageLogarithm(Gamma, Gaussian, NonconjugateGaussian)
Nonconjugate VMP message to 'd'.
Declaration
[Quality(QualityBand.Experimental)]
public static NonconjugateGaussian DNonconjugateAverageLogarithm(Gamma exp, Gaussian d, NonconjugateGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from 'exp'. Must be a proper distribution. If uniform, the result will be uniform. |
Gaussian | d | |
NonconjugateGaussian | result |
Returns
Type | Description |
---|---|
NonconjugateGaussian | The outgoing nonconjugate VMP message to the 'd' argument. |
Remarks
The outgoing message is the exponential of the integral of the log-factor times incoming messages, over all arguments except 'd'.
The formula is int log(f(d,x)) q(x) dx
where x = (exp)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageConditional(Gamma, Gaussian, Gaussian)
EP message to exp
.
Declaration
public static Gamma ExpAverageConditional(Gamma exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | to_d | Previous outgoing message to |
Returns
Type | Description |
---|---|
Gamma | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of exp
as the random arguments are varied. The formula is proj[p(exp) sum_(d) p(d) factor(exp,d)]/p(exp)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageConditional(GammaPower, Gaussian, Gaussian)
EP message to exp
.
Declaration
public static GammaPower ExpAverageConditional(GammaPower exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
GammaPower | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | to_d | Previous outgoing message to |
Returns
Type | Description |
---|---|
GammaPower | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of exp
as the random arguments are varied. The formula is proj[p(exp) sum_(d) p(d) factor(exp,d)]/p(exp)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageConditionalInit(Gaussian)
Declaration
public static Gamma ExpAverageConditionalInit(Gaussian d)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | d | Incoming message from |
Returns
Type | Description |
---|---|
Gamma |
Remarks
ExpAverageLogarithm(Gaussian)
VMP message to exp
.
Declaration
public static Gamma ExpAverageLogarithm(Gaussian d)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | d | Incoming message from |
Returns
Type | Description |
---|---|
Gamma | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of exp
as the random arguments are varied. The formula is proj[sum_(d) p(d) factor(exp,d)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageLogarithm(Gaussian, GammaPower)
VMP message to exp
.
Declaration
public static GammaPower ExpAverageLogarithm(Gaussian d, GammaPower result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | d | Incoming message from |
GammaPower | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GammaPower |
|
Remarks
The outgoing message is a distribution matching the moments of exp
as the random arguments are varied. The formula is proj[sum_(d) p(d) factor(exp,d)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageLogarithm(NonconjugateGaussian)
VMP message to exp
.
Declaration
[Quality(QualityBand.Experimental)]
public static Gamma ExpAverageLogarithm(NonconjugateGaussian d)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | d | Incoming message from |
Returns
Type | Description |
---|---|
Gamma | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of exp
as the random arguments are varied. The formula is proj[sum_(d) p(d) factor(exp,d)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExpAverageLogarithmInit()
Declaration
public static Gamma ExpAverageLogarithmInit()
Returns
Type | Description |
---|---|
Gamma |
Remarks
LogAverageFactor(CanGetLogProb<Double>, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(CanGetLogProb<double> exp, double d)
Parameters
Type | Name | Description |
---|---|---|
CanGetLogProb<Double> | exp | Incoming message from |
Double | d | 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_(exp) p(exp) factor(exp,d))
.
LogAverageFactor(Gamma, Gaussian, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gamma exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | to_d | Previous outgoing message to |
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_(exp,d) p(exp,d) factor(exp,d))
.
LogAverageFactor(GammaPower, Gaussian, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(GammaPower exp, Gaussian d, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
GammaPower | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gaussian | to_d | Previous outgoing message to |
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_(exp,d) p(exp,d) factor(exp,d))
.
LogAverageFactor(Double, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double exp, Gaussian d)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | Constant value for |
Gaussian | d | 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_(d) p(d) factor(exp,d))
.
LogAverageFactor(Double, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double exp, double d)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | Constant value for |
Double | d | 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(exp,d))
.
LogAverageFactor_slow(Gamma, Gaussian)
Evidence message for EP
Declaration
public static double LogAverageFactor_slow(Gamma exp, Gaussian d)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from 'exp'. |
Gaussian | d | Incoming message from 'd'. |
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_(exp,d) p(exp,d) factor(exp,d))
.
LogEvidenceRatio(Gamma, Gaussian, Gamma, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gamma exp, Gaussian d, Gamma to_exp, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
Gamma | exp | Incoming message from |
Gaussian | d | Incoming message from |
Gamma | to_exp | Outgoing message to |
Gaussian | to_d | Previous 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_(exp,d) p(exp,d) factor(exp,d) / sum_exp p(exp) messageTo(exp))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(GammaPower, Gaussian, GammaPower, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(GammaPower exp, Gaussian d, GammaPower to_exp, Gaussian to_d)
Parameters
Type | Name | Description |
---|---|---|
GammaPower | exp | Incoming message from |
Gaussian | d | Incoming message from |
GammaPower | to_exp | Outgoing message to |
Gaussian | to_d | Previous 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_(exp,d) p(exp,d) factor(exp,d) / sum_exp p(exp) messageTo(exp))
. 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 exp, Gaussian d)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | Constant value for |
Gaussian | d | 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_(d) p(d) factor(exp,d))
. 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 exp, double d)
Parameters
Type | Name | Description |
---|---|---|
Double | exp | Constant value for |
Double | d | 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(exp,d))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.