Class VectorFromArrayOp
Provides outgoing messages for FromArray(Double[]), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(new string[]{"vector", "array"}, typeof(Vector), "FromArray", new Type[]{typeof(double[])})]
[Quality(QualityBand.Preview)]
public static class VectorFromArrayOp
Methods
ArrayAverageConditional<GaussianList>(VectorGaussian, IList<Gaussian>, GaussianList)
EP message to data
.
Declaration
public static GaussianList ArrayAverageConditional<GaussianList>(VectorGaussian vector, IList<Gaussian> array, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | vector | Incoming message from |
IList<Gaussian> | array | Incoming message from |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the outgoing message. |
Remarks
The outgoing message is a distribution matching the moments of data
as the random arguments are varied. The formula is proj[p(data) sum_(fromArray) p(fromArray) factor(fromArray,data)]/p(data)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageConditional<GaussianList>(Vector, GaussianList)
EP message to data
.
Declaration
public static GaussianList ArrayAverageConditional<GaussianList>(Vector vector, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of data
conditioned on the given values.
ArrayAverageLogarithm<GaussianList>(VectorGaussian, IList<Gaussian>, GaussianList)
VMP message to data
.
Declaration
public static GaussianList ArrayAverageLogarithm<GaussianList>(VectorGaussian vector, IList<Gaussian> array, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | vector | Incoming message from |
IList<Gaussian> | array | Incoming message from |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of data
with fromArray
integrated out. The formula is sum_fromArray p(fromArray) factor(fromArray,data)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
ArrayAverageLogarithm<GaussianList>(Vector, GaussianList)
VMP message to data
.
Declaration
public static GaussianList ArrayAverageLogarithm<GaussianList>(Vector vector, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of data
conditioned on the given values.
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(fromArray,data))
. 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 vector, VectorGaussian to_vector)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | vector | Incoming message from |
VectorGaussian | to_vector | 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_(fromArray) p(fromArray) factor(fromArray,data))
.
LogAverageFactor(Vector, IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Vector vector, IList<Gaussian> array)
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
IList<Gaussian> | array | 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_(data) p(data) factor(fromArray,data))
.
LogAverageFactor(Vector, Double[])
Evidence message for EP.
Declaration
public static double LogAverageFactor(Vector vector, double[] array)
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
Double[] | array | 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(fromArray,data))
.
LogEvidenceRatio(VectorGaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(VectorGaussian vector)
Parameters
Type | Name | Description |
---|---|---|
VectorGaussian | vector | 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_(fromArray) p(fromArray) factor(fromArray,data) / sum_fromArray p(fromArray) messageTo(fromArray))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Vector, IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Vector vector, IList<Gaussian> array)
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
IList<Gaussian> | array | 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_(data) p(data) factor(fromArray,data))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Vector, Double[])
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Vector vector, double[] array)
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Constant value for |
Double[] | array | 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(fromArray,data))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
VectorAverageConditional(IList<Gaussian>, VectorGaussian)
EP message to fromArray
.
Declaration
public static VectorGaussian VectorAverageConditional(IList<Gaussian> array, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | array | Incoming message from |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is a distribution matching the moments of fromArray
as the random arguments are varied. The formula is proj[p(fromArray) sum_(data) p(data) factor(fromArray,data)]/p(fromArray)
.
VectorAverageConditionalInit(IList<Gaussian>)
Declaration
public static VectorGaussian VectorAverageConditionalInit(IList<Gaussian> array)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | array | Incoming message from |
Returns
Type | Description |
---|---|
VectorGaussian |
Remarks
VectorAverageLogarithm(IList<Gaussian>, VectorGaussian)
VMP message to fromArray
.
Declaration
public static VectorGaussian VectorAverageLogarithm(IList<Gaussian> array, VectorGaussian result)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | array | Incoming message from |
VectorGaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
VectorGaussian |
|
Remarks
The outgoing message is a distribution matching the moments of fromArray
as the random arguments are varied. The formula is proj[sum_(data) p(data) factor(fromArray,data)]
.
VectorAverageLogarithmInit(IList<Gaussian>)
Declaration
public static VectorGaussian VectorAverageLogarithmInit(IList<Gaussian> array)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | array | Incoming message from |
Returns
Type | Description |
---|---|
VectorGaussian |
Remarks