Class GateExitRandomOp
Provides outgoing messages for ExitRandom<T>(Boolean[], T[]), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Gate), "ExitRandom<>", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class GateExitRandomOp
Methods
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Average of the factor's log-value across the given argument distributions. |
Remarks
The formula for the result is log(factor(Exit,cases,values))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
CasesAverageConditional<TResultList>(TResultList)
EP message to cases
.
Declaration
public static TResultList CasesAverageConditional<TResultList>(TResultList result)
where TResultList : SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
TResultList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TResultList |
|
Type Parameters
Name | Description |
---|---|
TResultList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of cases
conditioned on the given values.
CasesAverageLogarithm<TResultList>(TResultList)
VMP message to cases
.
Declaration
public static TResultList CasesAverageLogarithm<TResultList>(TResultList result)
where TResultList : SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
TResultList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TResultList |
|
Type Parameters
Name | Description |
---|---|
TResultList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of cases
conditioned on the given values.
ExitAverageConditional<TExit>(Boolean[], IList<TExit>)
EP message to Exit
.
Declaration
public static TExit ExitAverageConditional<TExit>(bool[] cases, [SkipIfAllUniform] IList<TExit> values)
Parameters
Type | Name | Description |
---|---|---|
Boolean[] | cases | Constant value for |
IList<TExit> | values | Incoming message from |
Returns
Type | Description |
---|---|
TExit | The outgoing EP message to the |
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is a distribution matching the moments of Exit
as the random arguments are varied. The formula is proj[p(Exit) sum_(values) p(values) factor(Exit,cases,values)]/p(Exit)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExitAverageLogarithm<TExit>(IList<Bernoulli>, IList<TExit>, TExit)
VMP message to Exit
.
Declaration
public static TExit ExitAverageLogarithm<TExit>(IList<Bernoulli> cases, [SkipIfAllUniform] IList<TExit> values, TExit result)
where TExit : ICloneable, SettableToProduct<TExit>, SettableToPower<TExit>, CanGetAverageLog<TExit>, SettableToUniform, SettableTo<TExit>, SettableToRatio<TExit>, SettableToWeightedSum<TExit>
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | cases | Incoming message from |
IList<TExit> | values | Incoming message from |
TExit | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TExit |
|
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except Exit
. The formula is exp(sum_(cases,values) p(cases,values) log(factor(Exit,cases,values)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ExitAverageLogarithmInit<TExit>(IList<TExit>)
Declaration
public static TExit ExitAverageLogarithmInit<TExit>(IList<TExit> values)
where TExit : ICloneable
Parameters
Type | Name | Description |
---|---|---|
IList<TExit> | values | Incoming message from |
Returns
Type | Description |
---|---|
TExit |
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
Remarks
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(Exit,cases,values))
.
ValuesAverageConditional<TExit>(TExit, TExit[])
EP message to values
.
Declaration
public static TExit[] ValuesAverageConditional<TExit>(TExit exit, TExit[] result)
Parameters
Type | Name | Description |
---|---|---|
TExit | exit | Incoming message from |
TExit[] | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TExit[] |
|
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is a distribution matching the moments of values
as the random arguments are varied. The formula is proj[p(values) sum_(Exit) p(Exit) factor(Exit,cases,values)]/p(values)
.
ValuesAverageConditional<TExit, TResultList>(TExit, TResultList)
EP message to values
.
Declaration
public static TResultList ValuesAverageConditional<TExit, TResultList>(TExit exit, TResultList result)
where TResultList : CanSetAllElementsTo<TExit>
Parameters
Type | Name | Description |
---|---|---|
TExit | exit | Incoming message from |
TResultList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TResultList |
|
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
TResultList | The type of the outgoing message. |
Remarks
The outgoing message is a distribution matching the moments of values
as the random arguments are varied. The formula is proj[p(values) sum_(Exit) p(Exit) factor(Exit,cases,values)]/p(values)
.
ValuesAverageLogarithm<TExit>(TExit, TExit[])
VMP message to values
.
Declaration
public static TExit[] ValuesAverageLogarithm<TExit>(TExit exit, TExit[] result)
Parameters
Type | Name | Description |
---|---|---|
TExit | exit | Incoming message from |
TExit[] | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TExit[] |
|
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except values
. The formula is exp(sum_(Exit) p(Exit) log(factor(Exit,cases,values)))
.
ValuesAverageLogarithm<TExit, TResultList>(TExit, TResultList)
VMP message to values
.
Declaration
public static TResultList ValuesAverageLogarithm<TExit, TResultList>(TExit exit, TResultList result)
where TResultList : CanSetAllElementsTo<TExit>
Parameters
Type | Name | Description |
---|---|---|
TExit | exit | Incoming message from |
TResultList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TResultList |
|
Type Parameters
Name | Description |
---|---|
TExit | The type of the distribution over the variable exiting the gate. |
TResultList | The type of the outgoing message. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except values
. The formula is exp(sum_(Exit) p(Exit) log(factor(Exit,cases,values)))
.