Class DiscreteFromDiscreteOp
Provides outgoing messages for Discrete(Int32, Matrix), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(new string[]{"sample", "selector", "probs"}, typeof(Factor), "Discrete", new Type[]{typeof(int), typeof(Matrix)})]
[Quality(QualityBand.Experimental)]
public static class DiscreteFromDiscreteOp
Methods
LogAverageFactor(Discrete, Discrete, Matrix)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Discrete sample, Discrete selector, Matrix probs)
Parameters
Type | Name | Description |
---|---|---|
Discrete | sample | Incoming message from |
Discrete | selector | Incoming message from |
Matrix | probs | 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(sum_(sample,selector) p(sample,selector) factor(sample,selector,probs))
.
LogEvidenceRatio(Discrete, Discrete, Matrix)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Discrete sample, Discrete selector, Matrix probs)
Parameters
Type | Name | Description |
---|---|---|
Discrete | sample | Incoming message from |
Discrete | selector | Incoming message from |
Matrix | probs | 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(sum_(sample,selector) p(sample,selector) factor(sample,selector,probs) / sum_sample p(sample) messageTo(sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
SampleAverageConditional(Discrete, Matrix, Discrete)
EP message to sample
.
Declaration
public static Discrete SampleAverageConditional(Discrete selector, Matrix probs, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | selector | Incoming message from |
Matrix | probs | Constant value for |
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
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_(selector) p(selector) factor(sample,selector,probs)]/p(sample)
.
SelectorAverageConditional(Discrete, Matrix, Discrete)
EP message to selector
.
Declaration
public static Discrete SelectorAverageConditional(Discrete sample, Matrix probs, Discrete result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | sample | Incoming message from |
Matrix | probs | Constant value for |
Discrete | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Discrete |
|
Remarks
The outgoing message is a distribution matching the moments of selector
as the random arguments are varied. The formula is proj[p(selector) sum_(sample) p(sample) factor(sample,selector,probs)]/p(selector)
.