Class InnerProductArrayOp
Provides outgoing messages for InnerProduct(Double[], Double[]), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "InnerProduct", new Type[]{typeof(double[]), typeof(double[])})]
[Quality(QualityBand.Experimental)]
public static class InnerProductArrayOp
Methods
AAverageConditional<GaussianList>(Gaussian, IList<Gaussian>, GaussianList)
EP message to a
.
Declaration
[NotSupported("A InnerProduct factor between two Gaussian arrays is not yet implemented for Expectation Propagation. Try using Variational Message Passing.")]
public static GaussianList AAverageConditional<GaussianList>(Gaussian innerProduct, IList<Gaussian> B, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | B | Incoming message from |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
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,b) p(innerProduct,b) factor(innerProduct,a,b)]/p(a)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AAverageConditional<GaussianList>(Gaussian, IList<Gaussian>, Double[], Gaussian, GaussianList)
EP message to a
.
Declaration
public static GaussianList AAverageConditional<GaussianList>(Gaussian innerProduct, IList<Gaussian> A, double[] B, Gaussian to_innerProduct, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
Double[] | B | Constant value for |
Gaussian | to_innerProduct | Outgoing message to |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
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<GaussianList>(Double, Double[], GaussianList)
EP message to a
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented for Expectation Propagation.")]
public static GaussianList AAverageConditional<GaussianList>(double innerProduct, double[] B, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | B | Constant value for |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
Remarks
The outgoing message is the factor viewed as a function of a
conditioned on the given values.
AAverageLogarithm<GaussianList>(Gaussian, IList<Gaussian>, IList<Gaussian>, GaussianList)
VMP message to a
.
Declaration
public static GaussianList AAverageLogarithm<GaussianList>(Gaussian innerProduct, IList<Gaussian> A, IList<Gaussian> B, GaussianList to_A)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
IList<Gaussian> | B | Incoming message from |
GaussianList | to_A | Previous outgoing message to |
Returns
Type | Description |
---|---|
GaussianList | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList |
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<GaussianList>(Gaussian, IList<Gaussian>, Double[], GaussianList)
VMP message to a
.
Declaration
public static GaussianList AAverageLogarithm<GaussianList>(Gaussian innerProduct, IList<Gaussian> A, double[] B, GaussianList to_A)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
Double[] | B | Constant value for |
GaussianList | to_A | Previous outgoing message to |
Returns
Type | Description |
---|---|
GaussianList | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList |
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 |
|
ImproperMessageException |
|
AAverageLogarithm<GaussianList>(Double)
Declaration
[NotSupported("Variational Message Passing does not support a InnerProduct factor with fixed output.")]
public static GaussianList AAverageLogarithm<GaussianList>(double innerProduct)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct |
Returns
Type | Description |
---|---|
GaussianList |
Type Parameters
Name | Description |
---|---|
GaussianList |
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.
AverageLogFactor(Double, Double[], Double[])
Evidence message for VMP.
Declaration
public static double AverageLogFactor(double innerProduct, double[] A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
Double[] | B | Constant value for |
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<GaussianList>(Gaussian, IList<Gaussian>, GaussianList)
EP message to b
.
Declaration
[NotSupported("A InnerProduct factor between two Gaussian arrays is not yet implemented for Expectation Propagation. Try using Variational Message Passing.")]
public static GaussianList BAverageConditional<GaussianList>(Gaussian innerProduct, IList<Gaussian> A, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
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,a) p(innerProduct,a) factor(innerProduct,a,b)]/p(b)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
BAverageConditional<GaussianList>(Gaussian, Double[], IList<Gaussian>, Gaussian, GaussianList)
EP message to b
.
Declaration
public static GaussianList BAverageConditional<GaussianList>(Gaussian innerProduct, double[] A, IList<Gaussian> B, Gaussian to_innerProduct, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Double[] | A | Constant value for |
IList<Gaussian> | B | Incoming message from |
Gaussian | to_innerProduct | Previous outgoing message to |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
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 |
|
ImproperMessageException |
|
BAverageConditional<GaussianList>(Double, Double[], GaussianList)
EP message to b
.
Declaration
[NotSupported("A InnerProduct factor with fixed output is not yet implemented for Expectation Propagation.")]
public static GaussianList BAverageConditional<GaussianList>(double innerProduct, double[] A, GaussianList result)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
GaussianList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
GaussianList |
|
Type Parameters
Name | Description |
---|---|
GaussianList |
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
BAverageLogarithm(Double)
VMP message to b
.
Declaration
[NotSupported("Variational Message Passing does not support a InnerProduct factor with fixed output.")]
public static IList<Gaussian> BAverageLogarithm(double innerProduct)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Returns
Type | Description |
---|---|
IList<Gaussian> | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of b
conditioned on the given values.
BAverageLogarithm<GaussianList>(Gaussian, IList<Gaussian>, IList<Gaussian>, GaussianList)
VMP message to b
.
Declaration
public static GaussianList BAverageLogarithm<GaussianList>(Gaussian innerProduct, IList<Gaussian> A, IList<Gaussian> B, GaussianList to_B)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
IList<Gaussian> | B | Incoming message from |
GaussianList | to_B | Previous outgoing message to |
Returns
Type | Description |
---|---|
GaussianList | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList |
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 |
|
ImproperMessageException |
|
BAverageLogarithm<GaussianList>(Gaussian, Double[], IList<Gaussian>, GaussianList)
VMP message to b
.
Declaration
public static GaussianList BAverageLogarithm<GaussianList>(Gaussian innerProduct, double[] A, IList<Gaussian> B, GaussianList to_B)
where GaussianList : IList<Gaussian>
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Double[] | A | Constant value for |
IList<Gaussian> | B | Incoming message from |
GaussianList | to_B | Previous outgoing message to |
Returns
Type | Description |
---|---|
GaussianList | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
GaussianList |
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 |
|
ImproperMessageException |
|
InnerProductAverageConditional(IList<Gaussian>, IList<Gaussian>, IList<Gaussian>)
EP message to innerProduct
.
Declaration
[NotSupported("A InnerProduct factor between two Gaussian arrays is not yet implemented for Expectation Propagation. Try using Variational Message Passing.")]
public static Gaussian InnerProductAverageConditional(IList<Gaussian> A, IList<Gaussian> B, IList<Gaussian> result)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
IList<Gaussian> | B | Incoming message from |
IList<Gaussian> | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Gaussian |
|
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[p(innerProduct) sum_(a,b) p(a,b) factor(innerProduct,a,b)]/p(innerProduct)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
InnerProductAverageConditional(IList<Gaussian>, Double[])
EP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageConditional(IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
Double[] | B | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[p(innerProduct) sum_(a) p(a) factor(innerProduct,a,b)]/p(innerProduct)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
InnerProductAverageConditional(Double[], IList<Gaussian>)
EP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageConditional(double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Double[] | A | Constant value for |
IList<Gaussian> | B | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[p(innerProduct) sum_(b) p(b) factor(innerProduct,a,b)]/p(innerProduct)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
InnerProductAverageLogarithm(IList<Gaussian>, IList<Gaussian>, Gaussian)
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(IList<Gaussian> A, IList<Gaussian> B, Gaussian result)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
IList<Gaussian> | B | Incoming message from |
Gaussian | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Gaussian |
|
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[sum_(a,b) p(a,b) factor(innerProduct,a,b)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
InnerProductAverageLogarithm(IList<Gaussian>, Double[])
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
Double[] | B | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[sum_(a) p(a) factor(innerProduct,a,b)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
InnerProductAverageLogarithm(Double[], IList<Gaussian>)
VMP message to innerProduct
.
Declaration
public static Gaussian InnerProductAverageLogarithm(double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Double[] | A | Constant value for |
IList<Gaussian> | B | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of innerProduct
as the random arguments are varied. The formula is proj[sum_(b) p(b) factor(innerProduct,a,b)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
InnerProductAverageLogarithmInit(IList<Gaussian>, IList<Gaussian>)
Declaration
public static Gaussian InnerProductAverageLogarithmInit(IList<Gaussian> A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
IList<Gaussian> | B | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian |
Remarks
InnerProductAverageLogarithmInit(IList<Gaussian>, Double[])
Declaration
public static Gaussian InnerProductAverageLogarithmInit(IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
IList<Gaussian> | A | Incoming message from |
Double[] | B | Constant value for |
Returns
Type | Description |
---|---|
Gaussian |
Remarks
InnerProductAverageLogarithmInit(Double[], IList<Gaussian>)
Declaration
public static Gaussian InnerProductAverageLogarithmInit(double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Double[] | A | Constant value for |
IList<Gaussian> | B | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian |
Remarks
LogAverageFactor(Gaussian, IList<Gaussian>, Double[])
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gaussian innerProduct, IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
Double[] | 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(sum_(innerProduct,a) p(innerProduct,a) factor(innerProduct,a,b))
.
LogAverageFactor(Gaussian, Double[], IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gaussian innerProduct, double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Double[] | A | Constant value for |
IList<Gaussian> | B | 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_(innerProduct,b) p(innerProduct,b) factor(innerProduct,a,b))
.
LogAverageFactor(Double, IList<Gaussian>, Double[])
Evidence message for EP.
Declaration
public static double LogAverageFactor(double innerProduct, IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
IList<Gaussian> | A | Incoming message from |
Double[] | 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(sum_(a) p(a) factor(innerProduct,a,b))
.
LogAverageFactor(Double, Double[], IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(double innerProduct, double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
IList<Gaussian> | B | 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_(b) p(b) factor(innerProduct,a,b))
.
LogAverageFactor(Double, Double[], Double[])
Evidence message for EP.
Declaration
public static double LogAverageFactor(double innerProduct, double[] A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
Double[] | 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))
.
LogEvidenceRatio(Gaussian, IList<Gaussian>, Double[])
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gaussian innerProduct, IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
IList<Gaussian> | A | Incoming message from |
Double[] | 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, Double[], IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gaussian innerProduct, double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | innerProduct | Incoming message from |
Double[] | A | Constant value for |
IList<Gaussian> | 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, IList<Gaussian>, Double[])
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double innerProduct, IList<Gaussian> A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
IList<Gaussian> | A | Incoming message from |
Double[] | 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_(a) p(a) factor(innerProduct,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, Double[], IList<Gaussian>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double innerProduct, double[] A, IList<Gaussian> B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
IList<Gaussian> | 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_(b) p(b) factor(innerProduct,a,b))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Double, Double[], Double[])
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(double innerProduct, double[] A, double[] B)
Parameters
Type | Name | Description |
---|---|---|
Double | innerProduct | Constant value for |
Double[] | A | Constant value for |
Double[] | 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.