Class InnerProductOpBase
Provides outgoing messages for InnerProduct(Vector, Vector), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class InnerProductOpBase
Methods
AAverageConditional(Gaussian, Vector, VectorGaussian)
EP message to a
.
Declaration
public static VectorGaussian AAverageConditional(Gaussian innerProduct, Vector B, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | B | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
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_(innerProduct) p(innerProduct) factor(innerProduct,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional(Gaussian, Vector, DenseVector, PositiveDefiniteMatrix, VectorGaussian)
EP message to a
.
Declaration
public static VectorGaussian AAverageConditional(Gaussian innerProduct, Vector A, DenseVector BMean, PositiveDefiniteMatrix BVariance, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | A | Constant value for |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
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_(innerProduct) p(innerProduct) factor(innerProduct,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional(Double, Vector, VectorGaussian)
EP message to a
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented.")]
public static VectorGaussian AAverageConditional(double innerProduct, Vector B, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | B | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of a
conditioned on the given values.
AAverageLogarithm(Gaussian, VectorGaussian, DenseVector, PositiveDefiniteMatrix, VectorGaussian)
VMP message to a
.
Declaration
public static VectorGaussian AAverageLogarithm(Gaussian innerProduct, VectorGaussian B, DenseVector BMean, PositiveDefiniteMatrix BVariance, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
VectorGaussian | B | Incoming message from |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. Because the factor is deterministic, innerProduct
is integrated out before taking the logarithm. The formula is exp(sum_(b) p(b) log(sum_innerProduct p(innerProduct) factor(innerProduct,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AAverageLogarithm(Gaussian, Vector, VectorGaussian)
VMP message to a
.
Declaration
public static VectorGaussian AAverageLogarithm(Gaussian innerProduct, Vector B, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | B | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of a
with innerProduct
integrated out. The formula is sum_innerProduct p(innerProduct) factor(innerProduct,a,b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageLogarithm(Double, VectorGaussian, VectorGaussian)
VMP message to a
.
Declaration
[NotSupported("Variational Message Passing does not support an InnerProduct factor with fixed output.")]
public static VectorGaussian AAverageLogarithm(double innerProduct, VectorGaussian B, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
VectorGaussian | B | Incoming message from |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except a
. The formula is exp(sum_(b) p(b) log(factor(innerProduct,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageLogarithm(Double, Vector, VectorGaussian)
VMP message to a
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented.")]
public static VectorGaussian AAverageLogarithm(double innerProduct, Vector B, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | B | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of a
conditioned on the given values.
AMean(VectorGaussian, PositiveDefiniteMatrix, DenseVector)
Update the buffer AMean
.
Declaration
public static DenseVector AMean(VectorGaussian A, PositiveDefiniteMatrix AVariance, DenseVector result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | A | Incoming message from |
PositiveDefiniteMatrix | AVariance | Buffer |
DenseVector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DenseVector |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AMeanInit(VectorGaussian)
Initialize the buffer AMean
.
Declaration
public static DenseVector AMeanInit(VectorGaussian A)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | A | Incoming message from |
Returns
Type | Description |
---|---|
DenseVector | Initial value of buffer |
Remarks
AVariance(VectorGaussian, PositiveDefiniteMatrix)
Update the buffer AVariance
.
Declaration
public static PositiveDefiniteMatrix AVariance(VectorGaussian A, PositiveDefiniteMatrix result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | A | Incoming message from |
PositiveDefiniteMatrix | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AVarianceInit(VectorGaussian)
Initialize the buffer AVariance
.
Declaration
public static PositiveDefiniteMatrix AVarianceInit(VectorGaussian A)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | A | Incoming message from |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix | Initial value of buffer |
Remarks
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(innerProduct,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
BAverageConditional(Gaussian, Vector, VectorGaussian)
EP message to b
.
Declaration
public static VectorGaussian BAverageConditional(Gaussian innerProduct, Vector A, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | A | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
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_(innerProduct) p(innerProduct) factor(innerProduct,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageConditional(Double, Vector, VectorGaussian)
EP message to b
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented.")]
public static VectorGaussian BAverageConditional(double innerProduct, Vector A, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | A | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
BAverageLogarithm(Gaussian, VectorGaussian, DenseVector, PositiveDefiniteMatrix, VectorGaussian)
VMP message to b
.
Declaration
public static VectorGaussian BAverageLogarithm(Gaussian innerProduct, VectorGaussian A, DenseVector AMean, PositiveDefiniteMatrix AVariance, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
VectorGaussian | A | Incoming message from |
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except b
. Because the factor is deterministic, innerProduct
is integrated out before taking the logarithm. The formula is exp(sum_(a) p(a) log(sum_innerProduct p(innerProduct) factor(innerProduct,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
BAverageLogarithm(Gaussian, Vector, VectorGaussian)
VMP message to b
.
Declaration
public static VectorGaussian BAverageLogarithm(Gaussian innerProduct, Vector A, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | A | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of b
with innerProduct
integrated out. The formula is sum_innerProduct p(innerProduct) factor(innerProduct,a,b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageLogarithm(Double, VectorGaussian, VectorGaussian)
VMP message to b
.
Declaration
[NotSupported("Variational Message Passing does not support an InnerProduct factor with fixed output.")]
public static VectorGaussian BAverageLogarithm(double innerProduct, VectorGaussian A, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
VectorGaussian | A | Incoming message from |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except b
. The formula is exp(sum_(a) p(a) log(factor(innerProduct,a,b)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageLogarithm(Double, Vector, VectorGaussian)
VMP message to b
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented.")]
public static VectorGaussian BAverageLogarithm(double innerProduct, Vector A, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | A | Constant value for |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
BMean(VectorGaussian, PositiveDefiniteMatrix, DenseVector)
Update the buffer BMean
.
Declaration
public static DenseVector BMean(VectorGaussian B, PositiveDefiniteMatrix BVariance, DenseVector result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | B | Incoming message from |
PositiveDefiniteMatrix | BVariance | Buffer |
DenseVector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
DenseVector |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BMeanInit(VectorGaussian)
Initialize the buffer BMean
.
Declaration
public static DenseVector BMeanInit(VectorGaussian B)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | B | Incoming message from |
Returns
Type | Description |
---|---|
DenseVector | Initial value of buffer |
Remarks
BVariance(VectorGaussian, PositiveDefiniteMatrix)
Update the buffer BVariance
.
Declaration
public static PositiveDefiniteMatrix BVariance(VectorGaussian B, PositiveDefiniteMatrix result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | B | Incoming message from |
PositiveDefiniteMatrix | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BVarianceInit(VectorGaussian)
Initialize the buffer BVariance
.
Declaration
public static PositiveDefiniteMatrix BVarianceInit(VectorGaussian B)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | B | Incoming message from |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix | Initial value of buffer |
Remarks
InnerProductAverageConditional(DenseVector, PositiveDefiniteMatrix, Vector)
EP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageConditional(DenseVector AMean, PositiveDefiniteMatrix AVariance, Vector B)
Parameters
Type | Name | Description |
---|---|---|
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
Vector | B | 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 innerProduct
conditioned on the given values.
InnerProductAverageConditional(Vector, DenseVector, PositiveDefiniteMatrix)
EP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageConditional(Vector A, DenseVector BMean, PositiveDefiniteMatrix BVariance)
Parameters
Type | Name | Description |
---|---|---|
Vector | A | Constant value for |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of innerProduct
conditioned on the given values.
InnerProductAverageConditionalInit()
Declaration
public static Gaussian InnerProductAverageConditionalInit()
Returns
Type | Description |
---|---|
Gaussian |
Remarks
InnerProductAverageLogarithm(DenseVector, PositiveDefiniteMatrix, DenseVector, PositiveDefiniteMatrix)
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(DenseVector AMean, PositiveDefiniteMatrix AVariance, DenseVector BMean, PositiveDefiniteMatrix BVariance)
Parameters
Type | Name | Description |
---|---|---|
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of innerProduct
conditioned on the given values.
InnerProductAverageLogarithm(DenseVector, PositiveDefiniteMatrix, Vector)
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(DenseVector AMean, PositiveDefiniteMatrix AVariance, Vector B)
Parameters
Type | Name | Description |
---|---|---|
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
Vector | B | 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 innerProduct
conditioned on the given values.
InnerProductAverageLogarithm(Vector, DenseVector, PositiveDefiniteMatrix)
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(Vector A, DenseVector BMean, PositiveDefiniteMatrix BVariance)
Parameters
Type | Name | Description |
---|---|---|
Vector | A | Constant value for |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of innerProduct
conditioned on the given values.
InnerProductAverageLogarithmInit()
Declaration
public static Gaussian InnerProductAverageLogarithmInit()
Returns
Type | Description |
---|---|
Gaussian |
Remarks
LogAverageFactor(Gaussian, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gaussian innerProduct, Gaussian to_innerProduct)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Gaussian | to_innerProduct | 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_(innerProduct) p(innerProduct) factor(innerProduct,a,b))
.
LogAverageFactor(Double, DenseVector, PositiveDefiniteMatrix, Vector)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double innerProduct, DenseVector AMean, PositiveDefiniteMatrix AVariance, Vector B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
Vector | B | 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(innerProduct,a,b))
.
LogAverageFactor(Double, Vector, DenseVector, PositiveDefiniteMatrix)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double innerProduct, Vector A, DenseVector BMean, PositiveDefiniteMatrix BVariance)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | A | Constant value for |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | 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(factor(innerProduct,a,b))
.
LogEvidenceRatio(Gaussian, VectorGaussian, Vector)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gaussian innerProduct, VectorGaussian a, Vector B)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
VectorGaussian | a | Incoming message from |
Vector | B | 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(sum_(innerProduct,a) p(innerProduct,a) factor(innerProduct,a,b) / sum_innerProduct p(innerProduct) messageTo(innerProduct))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Gaussian, Vector, VectorGaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gaussian innerProduct, Vector A, VectorGaussian b)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Vector | A | Constant value for |
VectorGaussian | b | 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_(innerProduct,b) p(innerProduct,b) factor(innerProduct,a,b) / sum_innerProduct p(innerProduct) messageTo(innerProduct))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, DenseVector, PositiveDefiniteMatrix, Vector)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double innerProduct, DenseVector AMean, PositiveDefiniteMatrix AVariance, Vector B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
DenseVector | AMean | Buffer |
PositiveDefiniteMatrix | AVariance | Buffer |
Vector | B | 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(innerProduct,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, Vector, DenseVector, PositiveDefiniteMatrix)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double innerProduct, Vector A, DenseVector BMean, PositiveDefiniteMatrix BVariance)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Vector | A | Constant value for |
DenseVector | BMean | Buffer |
PositiveDefiniteMatrix | BVariance | Buffer |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(factor(innerProduct,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.