Class GammaProductOp_Laplace
Provides outgoing messages for Product(Double, Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "Product", new Type[]{typeof(double), typeof(double)})]
[Buffers(new string[]{"Q"})]
[Quality(QualityBand.Experimental)]
public static class GammaProductOp_Laplace
Fields
ForceProper
Declaration
public static bool ForceProper
Field Value
Type | Description |
---|---|
Boolean |
Methods
AAverageConditional(Gamma, Gamma, Gamma, Gamma)
EP message to a
.
Declaration
public static Gamma AAverageConditional(Gamma product, Gamma A, Gamma B, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | q | Buffer |
Returns
Type | Description |
---|---|
Gamma | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of a
as the random arguments are varied. The formula is proj[p(a) sum_(product,b) p(product,b) factor(product,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
BAverageConditional(Gamma, Gamma, Gamma, Gamma)
EP message to b
.
Declaration
public static Gamma BAverageConditional(Gamma product, Gamma A, Gamma B, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | q | Buffer |
Returns
Type | Description |
---|---|
Gamma | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of b
as the random arguments are varied. The formula is proj[p(b) sum_(product,a) p(product,a) factor(product,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
ImproperMessageException |
|
LogAverageFactor(Gamma, Gamma, Gamma, Gamma)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gamma product, Gamma A, Gamma B, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | q | 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_(product,a,b) p(product,a,b) factor(product,a,b))
.
LogEvidenceRatio(Gamma, Gamma, Gamma, Gamma, Gamma)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gamma product, Gamma A, Gamma B, Gamma to_product, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | to_product | Previous outgoing message to |
Gamma | q | Buffer |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(product,a,b) p(product,a,b) factor(product,a,b) / sum_product p(product) messageTo(product))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogEvidenceRatio(Double, Gamma, Gamma, Gamma)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double product, Gamma A, Gamma B, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Double | product | Constant value for |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | q | Buffer |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(a,b) p(a,b) factor(product,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
ProductAverageConditional(Gamma, Gamma, Gamma, Gamma)
EP message to product
.
Declaration
public static Gamma ProductAverageConditional(Gamma product, Gamma A, Gamma B, Gamma q)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Gamma | q | Buffer |
Returns
Type | Description |
---|---|
Gamma | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of product
as the random arguments are varied. The formula is proj[p(product) sum_(a,b) p(a,b) factor(product,a,b)]/p(product)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
Q(Gamma, Gamma, Gamma)
Update the buffer Q
.
Declaration
public static Gamma Q(Gamma product, Gamma A, Gamma B)
Parameters
Type | Name | Description |
---|---|---|
Gamma | product | Incoming message from |
Gamma | A | Incoming message from |
Gamma | B | Incoming message from |
Returns
Type | Description |
---|---|
Gamma | New value of buffer |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
QInit()
Initialize the buffer Q
.
Declaration
public static Gamma QInit()
Returns
Type | Description |
---|---|
Gamma | Initial value of buffer |
Remarks
ToGamma(GammaPower)
Declaration
public static Gamma ToGamma(GammaPower gammaPower)
Parameters
Type | Name | Description |
---|---|---|
GammaPower | gammaPower |
Returns
Type | Description |
---|---|
Gamma |