Class BernoulliFromBooleanOp
Provides outgoing messages for BernoulliFromBoolean(Boolean, Double, Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(new string[]{"Sample", "Choice", "ProbTrue0", "ProbTrue1"}, typeof(Factor), "BernoulliFromBoolean", new Type[]{typeof(bool), typeof(double), typeof(double)})]
public static class BernoulliFromBooleanOp
Methods
ChoiceAverageConditional(Bernoulli, Double, Double)
EP message to choice.
Declaration
public static Bernoulli ChoiceAverageConditional(Bernoulli sample, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Bernoulli | sample | Incoming message from |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of choice as the random arguments are varied. The formula is proj[p(choice) sum_(sample) p(sample) factor(sample,choice,probTrue0,probTrue1)]/p(choice).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ChoiceAverageConditional(Boolean, Double, Double)
EP message to choice.
Declaration
public static Bernoulli ChoiceAverageConditional(bool sample, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | sample | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | 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 choice conditioned on the given values.
ChoiceAverageLogarithm(Bernoulli, Double, Double)
VMP message to choice.
Declaration
public static Bernoulli ChoiceAverageLogarithm(Bernoulli sample, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Bernoulli | sample | Incoming message from |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except choice. The formula is exp(sum_(sample) p(sample) log(factor(sample,choice,probTrue0,probTrue1))).
ChoiceAverageLogarithm(Boolean, Double, Double)
VMP message to choice.
Declaration
public static Bernoulli ChoiceAverageLogarithm(bool sample, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | sample | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of choice conditioned on the given values.
ChoiceConditional(Boolean, Double, Double)
Gibbs message to choice.
Declaration
public static Bernoulli ChoiceConditional(bool sample, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | sample | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing Gibbs message to the |
Remarks
The outgoing message is the factor viewed as a function of choice conditioned on the given values.
SampleAverageConditional(Bernoulli, Double, Double)
EP message to sample.
Declaration
public static Bernoulli SampleAverageConditional(Bernoulli choice, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Bernoulli | choice | Incoming message from |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of sample as the random arguments are varied. The formula is proj[p(sample) sum_(choice) p(choice) factor(sample,choice,probTrue0,probTrue1)]/p(sample).
SampleAverageConditional(Boolean, Double, Double)
EP message to sample.
Declaration
public static Bernoulli SampleAverageConditional(bool choice, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | choice | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | 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 sample conditioned on the given values.
SampleAverageLogarithm(Bernoulli, Double, Double)
VMP message to sample.
Declaration
public static Bernoulli SampleAverageLogarithm(Bernoulli choice, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Bernoulli | choice | Incoming message from |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except sample. The formula is exp(sum_(choice) p(choice) log(factor(sample,choice,probTrue0,probTrue1))).
SampleAverageLogarithm(Boolean, Double, Double)
VMP message to sample.
Declaration
public static Bernoulli SampleAverageLogarithm(bool choice, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | choice | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of sample conditioned on the given values.
SampleConditional(Boolean, Double, Double)
Gibbs message to sample.
Declaration
public static Bernoulli SampleConditional(bool choice, double probTrue0, double probTrue1)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | choice | Constant value for |
| Double | probTrue0 | Constant value for |
| Double | probTrue1 | Constant value for |
Returns
| Type | Description |
|---|---|
| Bernoulli | The outgoing Gibbs message to the |
Remarks
The outgoing message is the factor viewed as a function of sample conditioned on the given values.