Class GateEnterOneOp<T>
Provides outgoing messages for EnterOne<T>(Int32, T, Int32), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Gate), "EnterOne<>", new Type[]{null, typeof(int), null, typeof(int)})]
[Quality(QualityBand.Mature)]
public static class GateEnterOneOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of the variable entering the gate. |
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(enterOne,selector,value,index))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
EnterOneAverageConditional<TValue>(TValue)
EP message to enterOne
.
Declaration
public static TValue EnterOneAverageConditional<TValue>(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | Incoming message from |
Returns
Type | Description |
---|---|
TValue | The outgoing EP message to the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the incoming message from |
Remarks
The outgoing message is a distribution matching the moments of enterOne
as the random arguments are varied. The formula is proj[p(enterOne) sum_(value) p(value) factor(enterOne,selector,value,index)]/p(enterOne)
.
EnterOneAverageLogarithm<TValue>(TValue)
VMP message to enterOne
.
Declaration
public static TValue EnterOneAverageLogarithm<TValue>(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | Incoming message from |
Returns
Type | Description |
---|---|
TValue | The outgoing VMP message to the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the incoming message from |
Remarks
The outgoing message is a distribution matching the moments of enterOne
as the random arguments are varied. The formula is proj[sum_(value) p(value) factor(enterOne,selector,value,index)]
.
LogAverageFactor()
Evidence message for EP.
Declaration
public static double LogAverageFactor()
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(enterOne,selector,value,index))
.
LogEvidenceRatio<TDist>(TDist)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDist>(TDist enterOne)
where TDist : IDistribution<T>
Parameters
Type | Name | Description |
---|---|---|
TDist | enterOne | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
TDist |
Remarks
The formula for the result is log(sum_(enterOne) p(enterOne) factor(enterOne,selector,value,index) / sum_enterOne p(enterOne) messageTo(enterOne))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
SelectorAverageConditional(Discrete)
EP message to selector
.
Declaration
public static Discrete SelectorAverageConditional(Discrete result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
Remarks
The outgoing message is the factor viewed as a function of selector
conditioned on the given values.
SelectorAverageLogarithm(Discrete)
VMP message to selector
.
Declaration
public static Discrete SelectorAverageLogarithm(Discrete result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
Remarks
The outgoing message is the factor viewed as a function of selector
conditioned on the given values.
ValueAverageConditional<TDist>(TDist, Discrete, TDist, Int32, TDist)
EP message to value
.
Declaration
public static TDist ValueAverageConditional<TDist>([SkipIfAllUniform] TDist enterOne, Discrete selector, TDist value, int index, TDist result)
where TDist : IDistribution<T>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, SettableTo<TDist>, SettableToPower<TDist>
Parameters
Type | Name | Description |
---|---|---|
TDist | enterOne | Incoming message from |
Discrete | selector | Incoming message from |
TDist | value | Incoming message from |
Int32 | index | Constant value for |
TDist | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDist |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the variable entering the gate. |
Remarks
The outgoing message is a distribution matching the moments of value
as the random arguments are varied. The formula is proj[p(value) sum_(enterOne,selector) p(enterOne,selector) factor(enterOne,selector,value,index)]/p(value)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
ValueAverageConditional<TDist>(TDist, Int32, Int32, TDist)
EP message to value
.
Declaration
public static TDist ValueAverageConditional<TDist>([SkipIfAllUniform] TDist enterOne, int selector, int index, TDist result)
where TDist : IDistribution<T>, SettableTo<TDist>
Parameters
Type | Name | Description |
---|---|---|
TDist | enterOne | Incoming message from |
Int32 | selector | Constant value for |
Int32 | index | Constant value for |
TDist | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDist |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the variable entering the gate. |
Remarks
The outgoing message is a distribution matching the moments of value
as the random arguments are varied. The formula is proj[p(value) sum_(enterOne) p(enterOne) factor(enterOne,selector,value,index)]/p(value)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ValueAverageLogarithm<TDist>(TDist, Discrete, Int32, TDist)
VMP message to value
.
Declaration
public static TDist ValueAverageLogarithm<TDist>(TDist enterOne, Discrete selector, int index, TDist result)
where TDist : SettableToPower<TDist>
Parameters
Type | Name | Description |
---|---|---|
TDist | enterOne | Incoming message from |
Discrete | selector | Incoming message from |
Int32 | index | Constant value for |
TDist | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDist |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the variable entering the gate. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except value
. Because the factor is deterministic, enterOne
is integrated out before taking the logarithm. The formula is exp(sum_(selector) p(selector) log(sum_enterOne p(enterOne) factor(enterOne,selector,value,index)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|