Class VectorElementOp
Provides outgoing messages for GetItem<T>(IReadOnlyList<T>, Int32), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Collection), "GetItem<>", new Type[]{typeof(double), typeof(Vector), typeof(int)})]
[Buffers(new string[]{"ArrayMean", "ArrayVariance"})]
[Quality(QualityBand.Preview)]
public static class VectorElementOp
Methods
ArrayAverageConditional(Gaussian, Int32, VectorGaussian)
EP message to array
.
Declaration
public static VectorGaussian ArrayAverageConditional(Gaussian item, int index, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | item | Incoming message from |
Int32 | index | 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 array
as the random arguments are varied. The formula is proj[p(array) sum_(item) p(item) factor(item,array,index)]/p(array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageConditional(Double, Int32, VectorGaussian)
EP message to array
.
Declaration
public static VectorGaussian ArrayAverageConditional(double item, int index, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | item | Constant value for |
Int32 | index | 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 array
conditioned on the given values.
ArrayAverageLogarithm(Gaussian, Int32, VectorGaussian)
VMP message to array
.
Declaration
public static VectorGaussian ArrayAverageLogarithm(Gaussian item, int index, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | item | Incoming message from |
Int32 | index | 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 array
with item
integrated out. The formula is sum_item p(item) factor(item,array,index)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageLogarithm(Double, Int32, VectorGaussian)
VMP message to array
.
Declaration
public static VectorGaussian ArrayAverageLogarithm(double item, int index, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Double | item | Constant value for |
Int32 | index | 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 array
conditioned on the given values.
ArrayMean(VectorGaussian, PositiveDefiniteMatrix, Vector)
Update the buffer ArrayMean
.
Declaration
public static Vector ArrayMean(VectorGaussian array, PositiveDefiniteMatrix ArrayVariance, Vector result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Vector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Vector |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayMeanInit(VectorGaussian)
Initialize the buffer ArrayMean
.
Declaration
public static Vector ArrayMeanInit(VectorGaussian array)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
Returns
Type | Description |
---|---|
Vector | Initial value of buffer |
Remarks
ArrayVariance(VectorGaussian, PositiveDefiniteMatrix)
Update the buffer ArrayVariance
.
Declaration
public static PositiveDefiniteMatrix ArrayVariance(VectorGaussian array, PositiveDefiniteMatrix result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
PositiveDefiniteMatrix | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayVarianceInit(VectorGaussian)
Initialize the buffer ArrayVariance
.
Declaration
public static PositiveDefiniteMatrix ArrayVarianceInit(VectorGaussian array)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix | Initial value of buffer |
Remarks
AverageLogFactor(Gaussian, VectorGaussian)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Gaussian item, VectorGaussian array)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | item | Incoming message from |
VectorGaussian | array | Incoming message from |
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.
AverageLogFactor(Double, VectorGaussian, Vector, PositiveDefiniteMatrix, Int32)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(double item, VectorGaussian array, Vector ArrayMean, PositiveDefiniteMatrix ArrayVariance, int index)
Parameters
Type | Name | Description |
---|---|---|
Double | item | Constant value for |
VectorGaussian | array | Incoming message from |
Vector | ArrayMean | Buffer |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Int32 | index | Constant value for |
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 |
|
ItemAverageConditional(VectorGaussian, Vector, PositiveDefiniteMatrix, Int32)
EP message to item
.
Declaration
public static Gaussian ItemAverageConditional(VectorGaussian array, Vector ArrayMean, PositiveDefiniteMatrix ArrayVariance, int index)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
Vector | ArrayMean | Buffer |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Int32 | index | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of item
as the random arguments are varied. The formula is proj[p(item) sum_(array) p(array) factor(item,array,index)]/p(item)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ItemAverageConditionalInit()
Declaration
public static Gaussian ItemAverageConditionalInit()
Returns
Type | Description |
---|---|
Gaussian |
Remarks
ItemAverageLogarithm(VectorGaussian, Vector, PositiveDefiniteMatrix, Int32)
VMP message to item
.
Declaration
public static Gaussian ItemAverageLogarithm(VectorGaussian array, Vector ArrayMean, PositiveDefiniteMatrix ArrayVariance, int index)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | array | Incoming message from |
Vector | ArrayMean | Buffer |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Int32 | index | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of item
as the random arguments are varied. The formula is proj[sum_(array) p(array) factor(item,array,index)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ItemAverageLogarithmInit()
Declaration
public static Gaussian ItemAverageLogarithmInit()
Returns
Type | Description |
---|---|
Gaussian |
Remarks
LogAverageFactor(Double, VectorGaussian, Vector, PositiveDefiniteMatrix, Int32)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double item, VectorGaussian array, Vector ArrayMean, PositiveDefiniteMatrix ArrayVariance, int index)
Parameters
Type | Name | Description |
---|---|---|
Double | item | Constant value for |
VectorGaussian | array | Incoming message from |
Vector | ArrayMean | Buffer |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Int32 | index | 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_(array) p(array) factor(item,array,index))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogEvidenceRatio(Double, VectorGaussian, Vector, PositiveDefiniteMatrix, Int32)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double item, VectorGaussian array, Vector ArrayMean, PositiveDefiniteMatrix ArrayVariance, int index)
Parameters
Type | Name | Description |
---|---|---|
Double | item | Constant value for |
VectorGaussian | array | Incoming message from |
Vector | ArrayMean | Buffer |
PositiveDefiniteMatrix | ArrayVariance | Buffer |
Int32 | index | 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_(array) p(array) factor(item,array,index))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|