Class AllTrueOp
Provides outgoing messages for AllTrue(IList<Boolean>), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "AllTrue", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class AllTrueOp
Methods
AllTrueAverageConditional(IList<Bernoulli>)
EP message to allTrue
.
Declaration
public static Bernoulli AllTrueAverageConditional(IList<Bernoulli> array)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | array | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of allTrue
as the random arguments are varied. The formula is proj[p(allTrue) sum_(array) p(array) factor(allTrue,array)]/p(allTrue)
.
AllTrueAverageConditional(IList<Boolean>)
EP message to allTrue
.
Declaration
public static Bernoulli AllTrueAverageConditional(IList<bool> array)
Parameters
Type | Name | Description |
---|---|---|
IList<Boolean> | array | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of allTrue
conditioned on the given values.
AllTrueAverageLogarithm(IList<Bernoulli>)
VMP message to allTrue
.
Declaration
public static Bernoulli AllTrueAverageLogarithm(IList<Bernoulli> array)
Parameters
Type | Name | Description |
---|---|---|
IList<Bernoulli> | array | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of allTrue
as the random arguments are varied. The formula is proj[sum_(array) p(array) factor(allTrue,array)]
.
ArrayAverageConditional<BernoulliList>(Bernoulli, IList<Bernoulli>, BernoulliList)
EP message to array
.
Declaration
public static BernoulliList ArrayAverageConditional<BernoulliList>(Bernoulli allTrue, IList<Bernoulli> array, BernoulliList result)
where BernoulliList : IList<Bernoulli>
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | allTrue | Incoming message from |
IList<Bernoulli> | array | Incoming message from |
BernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
BernoulliList |
|
Type Parameters
Name | Description |
---|---|
BernoulliList | The type of the resulting array. |
Remarks
The outgoing message is a distribution matching the moments of array
as the random arguments are varied. The formula is proj[p(array) sum_(allTrue) p(allTrue) factor(allTrue,array)]/p(array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageConditional<BernoulliList>(Bernoulli, IList<Boolean>, BernoulliList)
EP message to array
.
Declaration
public static BernoulliList ArrayAverageConditional<BernoulliList>(Bernoulli allTrue, IList<bool> array, BernoulliList result)
where BernoulliList : IList<Bernoulli>
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | allTrue | Incoming message from |
IList<Boolean> | array | Constant value for |
BernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
BernoulliList |
|
Type Parameters
Name | Description |
---|---|
BernoulliList | The type of the resulting array. |
Remarks
The outgoing message is a distribution matching the moments of array
as the random arguments are varied. The formula is proj[p(array) sum_(allTrue) p(allTrue) factor(allTrue,array)]/p(array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageConditional<BernoulliList>(Boolean, IList<Bernoulli>, BernoulliList)
EP message to array
.
Declaration
public static BernoulliList ArrayAverageConditional<BernoulliList>(bool allTrue, IList<Bernoulli> array, BernoulliList result)
where BernoulliList : IList<Bernoulli>
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Bernoulli> | array | Incoming message from |
BernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
BernoulliList |
|
Type Parameters
Name | Description |
---|---|
BernoulliList | The type of the resulting array. |
Remarks
The outgoing message is the factor viewed as a function of array
conditioned on the given values.
ArrayAverageLogarithm<BernoulliList>(Bernoulli, IList<Bernoulli>, BernoulliList)
VMP message to array
.
Declaration
public static BernoulliList ArrayAverageLogarithm<BernoulliList>(Bernoulli allTrue, IList<Bernoulli> array, BernoulliList result)
where BernoulliList : IList<Bernoulli>
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | allTrue | Incoming message from |
IList<Bernoulli> | array | Incoming message from |
BernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
BernoulliList |
|
Type Parameters
Name | Description |
---|---|
BernoulliList | The type of the resulting array. |
Remarks
The outgoing message is the factor viewed as a function of array
with allTrue
integrated out. The formula is sum_allTrue p(allTrue) factor(allTrue,array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageLogarithm<BernoulliList>(Boolean, IList<Bernoulli>, BernoulliList)
VMP message to array
.
Declaration
[NotSupported("Variational Message Passing does not support an AllTrue factor with fixed output.")]
public static BernoulliList ArrayAverageLogarithm<BernoulliList>(bool allTrue, IList<Bernoulli> array, BernoulliList result)
where BernoulliList : IList<Bernoulli>
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Bernoulli> | array | Incoming message from |
BernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
BernoulliList |
|
Type Parameters
Name | Description |
---|---|
BernoulliList | The type of the resulting array. |
Remarks
The outgoing message is the factor viewed as a function of array
conditioned on the given values.
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(allTrue,array))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Boolean, IList<Boolean>)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(bool allTrue, IList<bool> array)
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Boolean> | array | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(allTrue,array))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli allTrue, Bernoulli to_allTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | allTrue | Incoming message from |
Bernoulli | to_allTrue | Outgoing message to |
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_(allTrue) p(allTrue) factor(allTrue,array))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogAverageFactor(Boolean, IList<Bernoulli>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool allTrue, IList<Bernoulli> array)
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Bernoulli> | array | 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_(array) p(array) factor(allTrue,array))
.
LogAverageFactor(Boolean, IList<Boolean>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool allTrue, IList<bool> array)
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Boolean> | array | 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(allTrue,array))
.
LogEvidenceRatio(Bernoulli)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli allTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | allTrue | 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_(allTrue) p(allTrue) factor(allTrue,array) / sum_allTrue p(allTrue) messageTo(allTrue))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, IList<Bernoulli>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool allTrue, IList<Bernoulli> array)
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Bernoulli> | array | 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_(array) p(array) factor(allTrue,array))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, IList<Boolean>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool allTrue, IList<bool> array)
Parameters
Type | Name | Description |
---|---|---|
Boolean | allTrue | Constant value for |
IList<Boolean> | array | 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(allTrue,array))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.