Class GateExitOp<T>
Provides outgoing messages for Exit<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), "Exit<>", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class GateExitOp<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of the variable exiting the gate. |
Methods
AverageLogFactor<TDist>(TDist, TDist)
Evidence message for VMP.
Declaration
public static double AverageLogFactor<TDist>(TDist exit, TDist to_exit)
where TDist : IDistribution<T>, CanGetAverageLog<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| TDist | to_exit | Outgoing message to |
Returns
| Type | Description |
|---|---|
| Double | Zero. |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
CasesAverageConditional<TDist>(TDist, TDist, Int32)
EP message to cases.
Declaration
public static Bernoulli CasesAverageConditional<TDist>(TDist exit, TDist values, int resultIndex)
where TDist : IDistribution<T>, CanGetLogAverageOf<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| TDist | values | Incoming message from |
| Int32 | resultIndex | Index of the |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing EP message to the |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is a distribution matching the moments of cases as the random arguments are varied. The formula is proj[p(cases) sum_(exit,values) p(exit,values) factor(exit,cases,values)]/p(cases).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
CasesAverageConditional<TDist>(TDist, IList<T>, Int32)
EP message to cases.
Declaration
public static Bernoulli CasesAverageConditional<TDist>(TDist exit, IList<T> values, int resultIndex)
where TDist : CanGetLogProb<T>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<T> | values | Incoming message from |
| Int32 | resultIndex | Index of the |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing EP message to the |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
The outgoing message is a distribution matching the moments of cases as the random arguments are varied. The formula is proj[p(cases) sum_(exit,values) p(exit,values) factor(exit,cases,values)]/p(cases).
CasesAverageLogarithm<TDist>(TDist, IList<TDist>, Int32)
VMP message to cases.
Declaration
public static Bernoulli CasesAverageLogarithm<TDist>(TDist exit, [SkipIfAllUniform] IList<TDist> values, int resultIndex)
where TDist : CanGetAverageLog<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<TDist> | values | Incoming message from |
| Int32 | resultIndex | Index of the |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing VMP message to the |
Type Parameters
| Name | Description |
|---|---|
| TDist | 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 cases. Because the factor is deterministic, exit is integrated out before taking the logarithm. The formula is exp(sum_(values) p(values) log(sum_exit p(exit) factor(exit,cases,values))).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
| ImproperMessageException |
|
ExitAverageConditional<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)
EP message to exit.
Declaration
public static TDist ExitAverageConditional<TDist>(TDist exit, IList<Bernoulli> cases, IList<TDist> values, TDist result)
where TDist : IDistribution<T>, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Bernoulli> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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_(cases,values) p(cases,values) factor(exit,cases,values)]/p(exit).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageConditional<TDist>(TDist, IList<Bernoulli>, IList<T>, TDist)
EP message to exit.
Declaration
public static TDist ExitAverageConditional<TDist>(TDist exit, IList<Bernoulli> cases, IList<T> values, TDist result)
where TDist : ICloneable, HasPoint<T>, SettableToWeightedSum<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Bernoulli> | cases | Incoming message from |
| IList<T> | values | Incoming message from |
| 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 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_(cases,values) p(cases,values) factor(exit,cases,values)]/p(exit).
ExitAverageConditional<TDist>(TDist, IList<Boolean>, IList<TDist>, TDist)
EP message to exit.
Declaration
public static TDist ExitAverageConditional<TDist>(TDist exit, IList<bool> cases, IList<TDist> values, TDist result)
where TDist : SettableTo<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Boolean> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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_(cases,values) p(cases,values) factor(exit,cases,values)]/p(exit).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageConditional1<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)
EP message to exit.
Declaration
public static TDist ExitAverageConditional1<TDist>(TDist exit, IList<Bernoulli> cases, IList<TDist> values, TDist result)
where TDist : IDistribution<T>, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>, CanGetLogAverageOf<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Bernoulli> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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_(cases,values) p(cases,values) factor(exit,cases,values)]/p(exit).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageConditional2<TDist>(TDist, IList<Bernoulli>, IList<TDist>, TDist)
EP message to exit.
Declaration
public static TDist ExitAverageConditional2<TDist>(TDist exit, IList<Bernoulli> cases, [SkipIfAllUniform] IList<TDist> values, TDist result)
where TDist : SettableTo<TDist>, ICloneable, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Bernoulli> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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_(cases,values) p(cases,values) factor(exit,cases,values)]/p(exit).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageConditionalInit<TDist>(IList<TDist>)
Declaration
public static TDist ExitAverageConditionalInit<TDist>(IList<TDist> values)
where TDist : ICloneable
Parameters
| Type | Name | Description |
|---|---|---|
| IList<TDist> | values | Incoming message from |
Returns
| Type | Description |
|---|---|
| TDist |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
ExitAverageLogarithm<TDist>(TDist, IList<Boolean>, IList<TDist>, TDist)
VMP message to exit.
Declaration
public static TDist ExitAverageLogarithm<TDist>(TDist exit, IList<bool> cases, IList<TDist> values, TDist result)
where TDist : SettableTo<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Boolean> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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[sum_(cases,values) p(cases,values) factor(exit,cases,values)].
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageLogarithm<TDist>(IList<Bernoulli>, IList<TDist>, TDist)
VMP message to exit.
Declaration
public static TDist ExitAverageLogarithm<TDist>(IList<Bernoulli> cases, [SkipIfAllUniform] IList<TDist> values, TDist result)
where TDist : ICloneable, SettableToProduct<TDist>, SettableToPower<TDist>, CanGetAverageLog<TDist>, SettableToUniform, SettableTo<TDist>, SettableToRatio<TDist>, SettableToWeightedSum<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Bernoulli> | cases | Incoming message from |
| IList<TDist> | values | Incoming message from |
| 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 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[sum_(cases,values) p(cases,values) factor(exit,cases,values)].
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ExitAverageLogarithmInit<TDist>(IList<TDist>)
Declaration
public static TDist ExitAverageLogarithmInit<TDist>(IList<TDist> values)
where TDist : ICloneable
Parameters
| Type | Name | Description |
|---|---|---|
| IList<TDist> | values | Incoming message from |
Returns
| Type | Description |
|---|---|
| TDist |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
LogEvidenceRatio<TDist>(TDist, TDist)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDist>(TDist exit, TDist to_exit)
where TDist : IDistribution<T>, CanGetLogAverageOf<TDist>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| TDist | to_exit | Outgoing message to |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
The formula for the result is log(sum_(exit) p(exit) factor(exit,cases,values) / sum_exit p(exit) messageTo(exit)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
LogEvidenceRatio<TDist>(TDist, IList<Boolean>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDist>(TDist exit, IList<bool> cases)
where TDist : IDistribution<T>
Parameters
| Type | Name | Description |
|---|---|---|
| TDist | exit | Incoming message from |
| IList<Boolean> | cases | Incoming message from |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
| Name | Description |
|---|---|
| TDist | The type of the distribution over the variable exiting the gate. |
Remarks
The formula for the result is log(sum_(exit,cases) p(exit,cases) factor(exit,cases,values) / sum_exit p(exit) messageTo(exit)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
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 message from |
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 message from |
| 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[])
Declaration
public static TExit[] ValuesAverageLogarithm<TExit>(TExit exit, TExit[] result)
Parameters
| Type | Name | Description |
|---|---|---|
| TExit | exit | |
| TExit[] | result |
Returns
| Type | Description |
|---|---|
| TExit[] |
Type Parameters
| Name | Description |
|---|---|
| TExit | The type of the message from |
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 message from |
| TResultList | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of values with exit integrated out. The formula is sum_exit p(exit) factor(exit,cases,values).