Class GetJaggedItemsFromJaggedOp<T>
Provides outgoing messages for GetJaggedItemsFromJagged<T>(IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<Int32>>, IReadOnlyList<IReadOnlyList<Int32>>), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Collection), "GetJaggedItemsFromJagged<>", new Type[]{}, Default = true)]
[Quality(QualityBand.Mature)]
[Buffers(new string[]{"marginal"})]
public static class GetJaggedItemsFromJaggedOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of an item. |
Methods
ArrayAverageConditional<ItemType, DistributionType, ArrayType>(IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>, ArrayType)
EP message to array
.
Declaration
public static ArrayType ArrayAverageConditional<ItemType, DistributionType, ArrayType>([SkipIfAllUniform] IList<ItemType> items, IList<IList<int>> indices, IList<IList<int>> indices2, ArrayType result)
where ItemType : IList<DistributionType> where DistributionType : SettableToProduct<DistributionType> where ArrayType : IList<ItemType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
ArrayType | 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_(items,indices,indices2) p(items,indices,indices2) factor(items,array,indices,indices2)]/p(array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageConditional<ItemType, DistributionType, ArrayType>(IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>, ArrayType)
EP message to array
.
Declaration
public static ArrayType ArrayAverageConditional<ItemType, DistributionType, ArrayType>([SkipIfAllUniform] IList<IList<T>> items, IList<IList<int>> indices, IList<IList<int>> indices2, ArrayType result)
where ItemType : IList<DistributionType> where DistributionType : HasPoint<T> where ArrayType : IList<ItemType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
ArrayType | 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_(items,indices,indices2) p(items,indices,indices2) factor(items,array,indices,indices2)]/p(array)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageLogarithm<ItemType, DistributionType, ArrayType>(IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>, ArrayType)
Declaration
public static ArrayType ArrayAverageLogarithm<ItemType, DistributionType, ArrayType>([SkipIfAllUniform] IList<ItemType> items, IList<IList<int>> indices, IList<IList<int>> indices2, ArrayType result)
where ItemType : IList<DistributionType> where DistributionType : SettableToUniform, SettableToProduct<DistributionType> where ArrayType : IList<ItemType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the resulting array. |
ArrayAverageLogarithm<ItemType, DistributionType, ArrayType>(IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>, ArrayType)
VMP message to array
.
Declaration
public static ArrayType ArrayAverageLogarithm<ItemType, DistributionType, ArrayType>(IList<IList<T>> items, IList<IList<int>> indices, IList<IList<int>> indices2, ArrayType result)
where ItemType : IList<DistributionType> where DistributionType : HasPoint<T> where ArrayType : IList<ItemType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the resulting array. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except array
. Because the factor is deterministic, items
is integrated out before taking the logarithm. The formula is exp(sum_(indices,indices2) p(indices,indices2) log(sum_items p(items) factor(items,array,indices,indices2)))
.
AverageLogFactor(IList<IList<T>>, IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(IList<IList<T>> items, IList<IList<T>> array, IList<IList<int>> indices, IList<IList<int>> indices2)
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | Incoming message from |
IList<IList<T>> | array | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
Returns
Type | Description |
---|---|
Double | Zero. |
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.
AverageLogFactor<ItemType, DistributionType>(IList<ItemType>, IList<ItemType>)
Declaration
public static double AverageLogFactor<ItemType, DistributionType>(IList<ItemType> items, IList<ItemType> array)
where ItemType : IList<DistributionType> where DistributionType : SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<ItemType> | array |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
AverageLogFactor<ItemType, DistributionType>(IList<ItemType>, IList<IList<T>>)
Declaration
public static double AverageLogFactor<ItemType, DistributionType>(IList<ItemType> items, IList<IList<T>> array)
where ItemType : IList<DistributionType> where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<IList<T>> | array |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
AverageLogFactor<ItemType, DistributionType>(IList<IList<T>>, IList<ItemType>)
Declaration
public static double AverageLogFactor<ItemType, DistributionType>(IList<IList<T>> items, IList<ItemType> array)
where ItemType : IList<DistributionType> where DistributionType : HasPoint<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | |
IList<ItemType> | array |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
ItemsAverageConditional<ArrayType, ItemType, DistributionType>(ItemType, ArrayType, ArrayType, IList<IList<Int32>>, IList<IList<Int32>>, Int32, ItemType)
EP message to items
.
Declaration
public static ItemType ItemsAverageConditional<ArrayType, ItemType, DistributionType>(ItemType items, ArrayType array, [SkipIfAllUniform] ArrayType marginal, IList<IList<int>> indices, IList<IList<int>> indices2, int resultIndex, ItemType result)
where ArrayType : IList<ItemType> where ItemType : IList<DistributionType> where DistributionType : SettableToRatio<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ItemType | items | Incoming message from |
ArrayType | array | Incoming message from |
ArrayType | marginal | Buffer |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
Int32 | resultIndex | Index of the |
ItemType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ItemType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of an array for the marginal. |
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
Remarks
The outgoing message is a distribution matching the moments of items
as the random arguments are varied. The formula is proj[p(items) sum_(array,indices,indices2) p(array,indices,indices2) factor(items,array,indices,indices2)]/p(items)
.
ItemsAverageLogarithm<ItemType, DistributionType>(IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>, Int32, ItemType)
VMP message to items
.
Declaration
public static ItemType ItemsAverageLogarithm<ItemType, DistributionType>([SkipIfAllUniform] IList<ItemType> array, IList<IList<int>> indices, IList<IList<int>> indices2, int resultIndex, ItemType result)
where ItemType : IList<DistributionType> where DistributionType : SettableTo<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | array | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
Int32 | resultIndex | Index of the |
ItemType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ItemType |
|
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
Remarks
The outgoing message is a distribution matching the moments of items
as the random arguments are varied. The formula is proj[sum_(array,indices,indices2) p(array,indices,indices2) factor(items,array,indices,indices2)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogAverageFactor(IList<IList<T>>, IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogAverageFactor(IList<IList<T>> items, IList<IList<T>> array, IList<IList<int>> indices, IList<IList<int>> indices2)
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | |
IList<IList<T>> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
LogAverageFactor<ItemType, DistributionType>(IList<ItemType>, IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogAverageFactor<ItemType, DistributionType>(IList<ItemType> items, IList<ItemType> array, IList<IList<int>> indices, IList<IList<int>> indices2)
where ItemType : IList<DistributionType> where DistributionType : IDistribution<T>, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<ItemType> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
LogAverageFactor<ItemType, DistributionType>(IList<ItemType>, IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogAverageFactor<ItemType, DistributionType>(IList<ItemType> items, IList<IList<T>> array, IList<IList<int>> indices, IList<IList<int>> indices2)
where ItemType : IList<DistributionType> where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<IList<T>> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
LogAverageFactor<ItemType, DistributionType>(IList<IList<T>>, IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogAverageFactor<ItemType, DistributionType>(IList<IList<T>> items, IList<ItemType> array, IList<IList<int>> indices, IList<IList<int>> indices2)
where ItemType : IList<DistributionType> where DistributionType : HasPoint<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | |
IList<ItemType> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio(IList<IList<T>>, IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(IList<IList<T>> items, IList<IList<T>> array, IList<IList<int>> indices, IList<IList<int>> indices2)
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | Incoming message from |
IList<IList<T>> | array | Incoming message from |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | 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_(items,array,indices,indices2) p(items,array,indices,indices2) factor(items,array,indices,indices2) / sum_items p(items) messageTo(items))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<ItemType, DistributionType>(IList<ItemType>, IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>, IList<ItemType>)
Declaration
public static double LogEvidenceRatio<ItemType, DistributionType>(IList<ItemType> items, IList<ItemType> array, IList<IList<int>> indices, IList<IList<int>> indices2, IList<ItemType> to_items)
where ItemType : IList<DistributionType> where DistributionType : SettableToUniform, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>, ICloneable
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<ItemType> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 | |
IList<ItemType> | to_items |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio<ItemType, DistributionType>(IList<ItemType>, IList<IList<T>>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogEvidenceRatio<ItemType, DistributionType>(IList<ItemType> items, IList<IList<T>> array, IList<IList<int>> indices, IList<IList<int>> indices2)
where ItemType : IList<DistributionType> where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IList<IList<T>> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio<ItemType, DistributionType>(IList<IList<T>>, IList<ItemType>, IList<IList<Int32>>, IList<IList<Int32>>)
Declaration
public static double LogEvidenceRatio<ItemType, DistributionType>(IList<IList<T>> items, IList<ItemType> array, IList<IList<int>> indices, IList<IList<int>> indices2)
where ItemType : IList<DistributionType> where DistributionType : HasPoint<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IList<IList<T>> | items | |
IList<ItemType> | array | |
IList<IList<Int32>> | indices | |
IList<IList<Int32>> | indices2 |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
Marginal<ArrayType, DistributionType>(ArrayType, ArrayType, ArrayType)
Declaration
[SkipIfAllUniform(new string[]{"array", "to_array"})]
public static ArrayType Marginal<ArrayType, DistributionType>(ArrayType array, ArrayType to_array, ArrayType result)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : SettableToProduct<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | |
ArrayType | to_array | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
ArrayType | |
DistributionType |
MarginalIncrement<ArrayType, ItemType, DistributionType>(ArrayType, ItemType, ItemType, IList<IList<Int32>>, IList<IList<Int32>>, Int32)
Declaration
public static ArrayType MarginalIncrement<ArrayType, ItemType, DistributionType>(ArrayType result, ItemType to_item, ItemType item, IList<IList<int>> indices, IList<IList<int>> indices2, int resultIndex)
where ArrayType : IList<ItemType>, SettableTo<ArrayType> where ItemType : IList<DistributionType> where DistributionType : SettableToProduct<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | result | Modified to contain the outgoing message. |
ItemType | to_item | |
ItemType | item | |
IList<IList<Int32>> | indices | Incoming message from |
IList<IList<Int32>> | indices2 | Incoming message from |
Int32 | resultIndex | Index of the |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of an array for the marginal. |
ItemType | The type of a sub-array. |
DistributionType | The type of a distribution over array elements. |
Remarks
MarginalInit<ArrayType>(ArrayType)
Initialize the buffer marginal
.
Declaration
public static ArrayType MarginalInit<ArrayType>(ArrayType array)
where ArrayType : ICloneable
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | Incoming message from |
Returns
Type | Description |
---|---|
ArrayType | Initial value of buffer |
Type Parameters
Name | Description |
---|---|
ArrayType | The type of an array for the marginal. |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|