Class ConstrainEqualOp<T>
Provides outgoing messages for Equal<T>(T, T), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Constrain), "Equal<>", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class ConstrainEqualOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of the constrained variables. |
Methods
AAverageConditional<TDistribution>(TDistribution, TDistribution)
EP message to A
.
Declaration
public static TDistribution AAverageConditional<TDistribution>(TDistribution B, TDistribution result)
where TDistribution : SettableTo<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | B | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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_(B) p(B) factor(A,B)]/p(A)
.
AAverageConditional<TDistribution>(T, TDistribution)
EP message to A
.
Declaration
public static TDistribution AAverageConditional<TDistribution>(T B, TDistribution result)
where TDistribution : HasPoint<T>
Parameters
Type | Name | Description |
---|---|---|
T | B | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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_(B) p(B) factor(A,B)]/p(A)
.
AAverageLogarithm<TDistribution>(TDistribution, TDistribution)
VMP message to A
.
Declaration
[NotSupported("VMP does not support Constrain.Equal between random variables")]
public static TDistribution AAverageLogarithm<TDistribution>(TDistribution B, TDistribution result)
Parameters
Type | Name | Description |
---|---|---|
TDistribution | B | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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(A,B)))
.
AAverageLogarithm<TDistribution>(T, TDistribution)
VMP message to A
.
Declaration
public static TDistribution AAverageLogarithm<TDistribution>(T B, TDistribution result)
where TDistribution : HasPoint<T>
Parameters
Type | Name | Description |
---|---|---|
T | B | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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(A,B)))
.
AMaxConditional<TDistribution>(TDistribution, TDistribution)
Declaration
public static TDistribution AMaxConditional<TDistribution>(TDistribution B, TDistribution result)
where TDistribution : SettableTo<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | B | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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(A,B))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
BAverageConditional<TDistribution>(TDistribution, TDistribution)
EP message to B
.
Declaration
public static TDistribution BAverageConditional<TDistribution>(TDistribution A, TDistribution result)
where TDistribution : SettableTo<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | A | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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_(A) p(A) factor(A,B)]/p(B)
.
BAverageConditional<TDistribution>(T, TDistribution)
EP message to B
.
Declaration
public static TDistribution BAverageConditional<TDistribution>(T A, TDistribution result)
where TDistribution : HasPoint<T>
Parameters
Type | Name | Description |
---|---|---|
T | A | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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_(A) p(A) factor(A,B)]/p(B)
.
BAverageLogarithm<TDistribution>(TDistribution, TDistribution)
VMP message to B
.
Declaration
[NotSupported("VMP does not support Constrain.Equal between random variables")]
public static TDistribution BAverageLogarithm<TDistribution>(TDistribution A, TDistribution result)
Parameters
Type | Name | Description |
---|---|---|
TDistribution | A | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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(A,B)))
.
BAverageLogarithm<TDistribution>(T, TDistribution)
VMP message to B
.
Declaration
public static TDistribution BAverageLogarithm<TDistribution>(T A, TDistribution result)
where TDistribution : HasPoint<T>
Parameters
Type | Name | Description |
---|---|---|
T | A | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
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(A,B)))
.
BMaxConditional<TDistribution>(TDistribution, TDistribution)
Declaration
public static TDistribution BMaxConditional<TDistribution>(TDistribution A, TDistribution result)
where TDistribution : SettableTo<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | A | Incoming message from |
TDistribution | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDistribution |
|
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
LogAverageFactor(T, T)
Evidence message for EP.
Declaration
public static double LogAverageFactor(T a, T b)
Parameters
Type | Name | Description |
---|---|---|
T | a | Incoming message from |
T | 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_(A,B) p(A,B) factor(A,B))
.
LogAverageFactor<TDistribution>(TDistribution, TDistribution)
Evidence message for EP.
Declaration
public static double LogAverageFactor<TDistribution>(TDistribution a, TDistribution b)
where TDistribution : CanGetLogAverageOf<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | a | Incoming message from |
TDistribution | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
.
LogAverageFactor<TDistribution>(TDistribution, T)
Evidence message for EP.
Declaration
public static double LogAverageFactor<TDistribution>(TDistribution a, T b)
where TDistribution : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | a | Incoming message from |
T | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
.
LogAverageFactor<TDistribution>(T, TDistribution)
Evidence message for EP.
Declaration
public static double LogAverageFactor<TDistribution>(T a, TDistribution b)
where TDistribution : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
T | a | Incoming message from |
TDistribution | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
.
LogEvidenceRatio(T, T)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(T a, T b)
Parameters
Type | Name | Description |
---|---|---|
T | a | Incoming message from |
T | 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_(A,B) p(A,B) factor(A,B))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<TDistribution>(TDistribution, TDistribution)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDistribution>(TDistribution a, TDistribution b)
where TDistribution : CanGetLogAverageOf<TDistribution>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | a | Incoming message from |
TDistribution | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<TDistribution>(TDistribution, T)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDistribution>(TDistribution a, T b)
where TDistribution : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
TDistribution | a | Incoming message from |
T | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<TDistribution>(T, TDistribution)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDistribution>(T a, TDistribution b)
where TDistribution : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
T | a | Incoming message from |
TDistribution | b | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
TDistribution | The distribution over the constrained variables. |
Remarks
The formula for the result is log(sum_(A,B) p(A,B) factor(A,B))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.