Class GetItem2DOp<T>
Provides outgoing messages for GetItem2D<T>(T[,], Int32, Int32), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Collection), "GetItem2D<>", new Type[]{})]
[Quality(QualityBand.Stable)]
public static class GetItem2DOp<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of an item. |
Methods
ArrayAverageConditional<Distribution, DistributionArray>(Distribution, Int32, Int32, DistributionArray)
EP message to array.
Declaration
public static DistributionArray ArrayAverageConditional<Distribution, DistributionArray>(Distribution item, int index1, int index2, DistributionArray result)
where Distribution : SettableTo<Distribution> where DistributionArray : IArray2D<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| Distribution | item | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| DistributionArray | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| DistributionArray |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
| DistributionArray | The type of the outgoing message. |
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_(item) p(item) factor(item,array,index1,index2)]/p(array).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ArrayAverageConditional<Distribution, DistributionArray>(T, Int32, Int32, DistributionArray)
EP message to array.
Declaration
public static DistributionArray ArrayAverageConditional<Distribution, DistributionArray>(T item, int index1, int index2, DistributionArray result)
where Distribution : HasPoint<T> where DistributionArray : IArray2D<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| DistributionArray | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| DistributionArray |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
| DistributionArray | The type of the outgoing message. |
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_(item) p(item) factor(item,array,index1,index2)]/p(array).
ArrayAverageLogarithm<Distribution, DistributionArray>(Distribution, Int32, Int32, DistributionArray)
VMP message to array.
Declaration
public static DistributionArray ArrayAverageLogarithm<Distribution, DistributionArray>(Distribution item, int index1, int index2, DistributionArray result)
where Distribution : SettableTo<Distribution> where DistributionArray : IArray2D<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| Distribution | item | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| DistributionArray | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| DistributionArray |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
| DistributionArray | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of array with item integrated out. The formula is sum_item p(item) factor(item,array,index1,index2).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ArrayAverageLogarithm<Distribution, DistributionArray>(T, Int32, Int32, DistributionArray)
VMP message to array.
Declaration
public static DistributionArray ArrayAverageLogarithm<Distribution, DistributionArray>(T item, int index1, int index2, DistributionArray result)
where Distribution : HasPoint<T> where DistributionArray : IArray2D<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| DistributionArray | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| DistributionArray |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
| DistributionArray | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of array with item integrated out. The formula is sum_item p(item) factor(item,array,index1,index2).
AverageLogFactor()
Evidence message for VMP.
Declaration
public static double AverageLogFactor()
Returns
| Type | Description |
|---|---|
| Double | Zero. |
Remarks
The formula for the result is log(factor(item,array,index1,index2)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
ItemAverageConditional<Distribution>(IArray2D<Distribution>, Int32, Int32, Distribution)
EP message to item.
Declaration
public static Distribution ItemAverageConditional<Distribution>([SkipIfAllUniform] IArray2D<Distribution> array, int index1, int index2, Distribution result)
where Distribution : SettableTo<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| IArray2D<Distribution> | array | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| Distribution | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| Distribution |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The outgoing message is a distribution matching the moments of item as the random arguments are varied. The formula is proj[p(item) sum_(array) p(array) factor(item,array,index1,index2)]/p(item).
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
ItemAverageLogarithm<Distribution>(IArray2D<Distribution>, Int32, Int32, Distribution)
VMP message to item.
Declaration
public static Distribution ItemAverageLogarithm<Distribution>([SkipIfAllUniform] IArray2D<Distribution> array, int index1, int index2, Distribution result)
where Distribution : SettableTo<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| IArray2D<Distribution> | array | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
| Distribution | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| Distribution |
|
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The outgoing message is a distribution matching the moments of item as the random arguments are varied. The formula is proj[sum_(array) p(array) factor(item,array,index1,index2)].
Exceptions
| Type | Condition |
|---|---|
| ImproperMessageException |
|
LogAverageFactor<Distribution>(Distribution, Distribution)
Evidence message for EP.
Declaration
public static double LogAverageFactor<Distribution>(Distribution item, Distribution to_item)
where Distribution : CanGetLogAverageOf<Distribution>
Parameters
| Type | Name | Description |
|---|---|---|
| Distribution | item | Incoming message from |
| Distribution | to_item | Outgoing message to |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The formula for the result is log(sum_(item) p(item) factor(item,array,index1,index2)).
LogAverageFactor<Distribution>(T, IArray2D<Distribution>, Int32, Int32)
Evidence message for EP.
Declaration
public static double LogAverageFactor<Distribution>(T item, IArray2D<Distribution> array, int index1, int index2)
where Distribution : CanGetLogProb<T>
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | Incoming message from |
| IArray2D<Distribution> | array | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's average value across the given argument distributions. |
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The formula for the result is log(sum_(item,array) p(item,array) factor(item,array,index1,index2)).
LogEvidenceRatio<Distribution>(Distribution)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<Distribution>(Distribution item)
Parameters
| Type | Name | Description |
|---|---|---|
| Distribution | item | Incoming message from |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The formula for the result is log(sum_(item) p(item) factor(item,array,index1,index2) / sum_item p(item) messageTo(item)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<Distribution>(T, IArray2D<Distribution>, Int32, Int32)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<Distribution>(T item, IArray2D<Distribution> array, int index1, int index2)
where Distribution : CanGetLogProb<T>
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | Incoming message from |
| IArray2D<Distribution> | array | Incoming message from |
| Int32 | index1 | Constant value for |
| Int32 | index2 | Constant value for |
Returns
| Type | Description |
|---|---|
| Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
| Name | Description |
|---|---|
| Distribution | The type of the distribution over an item. |
Remarks
The formula for the result is log(sum_(item,array) p(item,array) factor(item,array,index1,index2) / sum_item p(item) messageTo(item)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.