Class SubvectorOp
Provides outgoing messages for Subvector(Vector, Int32, Int32), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Vector), "Subvector", new Type[]{typeof(Vector), typeof(int), typeof(int)})]
[Buffers(new string[]{"SourceMean", "SourceVariance"})]
[Quality(QualityBand.Stable)]
public static class SubvectorOp
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(subvector,source,startIndex,count))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Vector, Vector, Int32)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Vector subvector, Vector source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Vector | source | Constant value for |
Int32 | startIndex | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(subvector,source,startIndex,count))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(VectorGaussian, VectorGaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(VectorGaussian subvector, VectorGaussian to_subvector)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | subvector | Incoming message from |
VectorGaussian | to_subvector | 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_(subvector) p(subvector) factor(subvector,source,startIndex,count))
.
LogAverageFactor(Vector, Vector, PositiveDefiniteMatrix, Int32)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Vector subvector, Vector SourceMean, PositiveDefiniteMatrix SourceVariance, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Vector | SourceMean | Buffer |
PositiveDefiniteMatrix | SourceVariance | Buffer |
Int32 | startIndex | 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(subvector,source,startIndex,count))
.
LogAverageFactor(Vector, Vector, Int32)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Vector subvector, Vector source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Vector | source | Constant value for |
Int32 | startIndex | 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(subvector,source,startIndex,count))
.
LogEvidenceRatio(VectorGaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(VectorGaussian subvector)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | subvector | 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_(subvector) p(subvector) factor(subvector,source,startIndex,count) / sum_subvector p(subvector) messageTo(subvector))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Vector, Vector, PositiveDefiniteMatrix, Int32)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Vector subvector, Vector SourceMean, PositiveDefiniteMatrix SourceVariance, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Vector | SourceMean | Buffer |
PositiveDefiniteMatrix | SourceVariance | Buffer |
Int32 | startIndex | 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(subvector,source,startIndex,count))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Vector, Vector, Int32)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Vector subvector, Vector source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Vector | source | Constant value for |
Int32 | startIndex | 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(subvector,source,startIndex,count))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
SourceAverageConditional(VectorGaussian, Int32, VectorGaussian)
EP message to source
.
Declaration
public static VectorGaussian SourceAverageConditional(VectorGaussian subvector, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | subvector | Incoming message from |
Int32 | startIndex | 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 source
as the random arguments are varied. The formula is proj[p(source) sum_(subvector) p(subvector) factor(subvector,source,startIndex,count)]/p(source)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SourceAverageConditional(Vector, Int32, VectorGaussian)
EP message to source
.
Declaration
public static VectorGaussian SourceAverageConditional(Vector subvector, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Int32 | startIndex | 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 source
conditioned on the given values.
SourceAverageLogarithm(VectorGaussian, Int32, VectorGaussian)
VMP message to source
.
Declaration
public static VectorGaussian SourceAverageLogarithm(VectorGaussian subvector, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | subvector | Incoming message from |
Int32 | startIndex | 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 source
with subvector
integrated out. The formula is sum_subvector p(subvector) factor(subvector,source,startIndex,count)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SourceAverageLogarithm(Vector, Int32, VectorGaussian)
VMP message to source
.
Declaration
public static VectorGaussian SourceAverageLogarithm(Vector subvector, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Vector | subvector | Constant value for |
Int32 | startIndex | 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 source
conditioned on the given values.
SourceMean(VectorGaussian, PositiveDefiniteMatrix, Vector)
Update the buffer SourceMean
.
Declaration
public static Vector SourceMean(VectorGaussian Source, PositiveDefiniteMatrix SourceVariance, Vector result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | Source | Incoming message from |
PositiveDefiniteMatrix | SourceVariance | Buffer |
Vector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Vector |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SourceMeanInit(VectorGaussian)
Initialize the buffer SourceMean
.
Declaration
public static Vector SourceMeanInit(VectorGaussian Source)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | Source | Incoming message from |
Returns
Type | Description |
---|---|
Vector | Initial value of buffer |
Remarks
SourceVariance(VectorGaussian, PositiveDefiniteMatrix)
Update the buffer SourceVariance
.
Declaration
public static PositiveDefiniteMatrix SourceVariance(VectorGaussian Source, PositiveDefiniteMatrix result)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | Source | Incoming message from |
PositiveDefiniteMatrix | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix |
|
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SourceVarianceInit(VectorGaussian)
Initialize the buffer SourceVariance
.
Declaration
public static PositiveDefiniteMatrix SourceVarianceInit(VectorGaussian Source)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | Source | Incoming message from |
Returns
Type | Description |
---|---|
PositiveDefiniteMatrix | Initial value of buffer |
Remarks
SubvectorAverageConditional(Vector, PositiveDefiniteMatrix, Int32, VectorGaussian)
EP message to subvector
.
Declaration
public static VectorGaussian SubvectorAverageConditional(Vector SourceMean, PositiveDefiniteMatrix SourceVariance, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Vector | SourceMean | Buffer |
PositiveDefiniteMatrix | SourceVariance | Buffer |
Int32 | startIndex | 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 subvector
conditioned on the given values.
SubvectorAverageConditionalInit(Int32)
Declaration
public static VectorGaussian SubvectorAverageConditionalInit(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Constant value for |
Returns
Type | Description |
---|---|
VectorGaussian |
Remarks
SubvectorAverageLogarithm(Vector, PositiveDefiniteMatrix, Int32, VectorGaussian)
VMP message to subvector
.
Declaration
public static VectorGaussian SubvectorAverageLogarithm(Vector SourceMean, PositiveDefiniteMatrix SourceVariance, int startIndex, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
Vector | SourceMean | Buffer |
PositiveDefiniteMatrix | SourceVariance | Buffer |
Int32 | startIndex | 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 subvector
conditioned on the given values.
SubvectorAverageLogarithmInit(Int32)
Declaration
public static VectorGaussian SubvectorAverageLogarithmInit(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Constant value for |
Returns
Type | Description |
---|---|
VectorGaussian |
Remarks