Class JaggedSubarrayOp<T>
Provides outgoing messages for JaggedSubarray<T>(IReadOnlyList<T>, Int32[][]), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Collection), "JaggedSubarray<>", new Type[]{}, Default = true)]
[Buffers(new string[]{"marginal"})]
[Quality(QualityBand.Mature)]
public static class JaggedSubarrayOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of an array item. |
Methods
ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
Declaration
public static ArrayType ArrayAverageConditional<DistributionType, ArrayType>([SkipIfAllUniform] IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where DistributionType : SettableToProduct<DistributionType> where ArrayType : IList<DistributionType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<Int32>>, IReadOnlyList<IReadOnlyList<T>>, ArrayType)
Declaration
public static ArrayType ArrayAverageConditional<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<int>> indices, IReadOnlyList<IReadOnlyList<T>> items, ArrayType result)
where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
IReadOnlyList<IReadOnlyList<T>> | items | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
Declaration
public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType>([SkipIfAllUniform] IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where DistributionType : SettableToUniform, SettableToProduct<DistributionType> where ArrayType : IList<DistributionType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<Int32>>, IReadOnlyList<IReadOnlyList<T>>, ArrayType)
Declaration
public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType>(IReadOnlyList<IReadOnlyList<int>> indices, IReadOnlyList<IReadOnlyList<T>> items, ArrayType result)
where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
IReadOnlyList<IReadOnlyList<T>> | items | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
AverageLogFactor(IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<T>> | items | Incoming message from |
IReadOnlyList<T> | array | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | 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<DistributionType>(IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType>(IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<T>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
AverageLogFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
AverageLogFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ItemsAverageConditional<ArrayType, DistributionType, ItemType>(IReadOnlyList<DistributionType>, ArrayType, ArrayType, IReadOnlyList<IReadOnlyList<Int32>>, Int32, ItemType)
EP message to items
.
Declaration
public static ItemType ItemsAverageConditional<ArrayType, DistributionType, ItemType>(IReadOnlyList<DistributionType> items, ArrayType array, [SkipIfAllUniform] ArrayType marginal, IReadOnlyList<IReadOnlyList<int>> indices, int resultIndex, ItemType result)
where ArrayType : IList<DistributionType> where DistributionType : SettableToRatio<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | items | Incoming message from |
ArrayType | array | Incoming message from |
ArrayType | marginal | Buffer |
IReadOnlyList<IReadOnlyList<Int32>> | indices | 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 a message from |
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
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) p(array,indices) factor(items,array,indices)]/p(items)
.
ItemsAverageLogarithm<DistributionType, ItemType, ResultType>(IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>, ResultType)
VMP message to items
.
Declaration
public static ResultType ItemsAverageLogarithm<DistributionType, ItemType, ResultType>([SkipIfAllUniform] IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices, ResultType result)
where DistributionType : SettableTo<DistributionType> where ItemType : IList<DistributionType> where ResultType : IList<ItemType>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
ResultType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ResultType |
|
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
ResultType | The type of the outgoing message. |
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) p(array,indices) factor(items,array,indices)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogAverageFactor(IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<T>> | items | Incoming message from |
IReadOnlyList<T> | array | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | 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_(items,array,indices) p(items,array,indices) factor(items,array,indices))
.
LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<DistributionType>(IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<T>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
LogAverageFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
LogAverageFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio(IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<T>> | items | Incoming message from |
IReadOnlyList<T> | array | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | 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) p(items,array,indices) factor(items,array,indices) / sum_items p(items) messageTo(items))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<DistributionType>(IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogEvidenceRatio<DistributionType>(IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<T>> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<T>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>, IReadOnlyList<IReadOnlyList<DistributionType>>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices, IReadOnlyList<IReadOnlyList<DistributionType>> to_items)
where DistributionType : SettableToUniform, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType>, ICloneable
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | Incoming message from |
IReadOnlyList<DistributionType> | array | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
IReadOnlyList<IReadOnlyList<DistributionType>> | to_items | Previous outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
Remarks
The formula for the result is log(sum_(items,array,indices) p(items,array,indices) factor(items,array,indices) / sum_items p(items) messageTo(items))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogEvidenceRatio<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : CanGetLogProb<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
Marginal<ArrayType, DistributionType>(ArrayType, IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
Declaration
[SkipIfAllUniform(new string[]{"array", "items"})]
public static ArrayType Marginal<ArrayType, DistributionType>(ArrayType array, IReadOnlyList<IReadOnlyList<DistributionType>> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : SettableToProduct<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | |
IReadOnlyList<IReadOnlyList<DistributionType>> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
ArrayType | result |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
ArrayType | The type of a message from |
DistributionType | The type of a distribution over array elements. |
MarginalIncrement<ArrayType, DistributionType>(ArrayType, IReadOnlyList<DistributionType>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>, Int32)
Declaration
public static ArrayType MarginalIncrement<ArrayType, DistributionType>(ArrayType result, IReadOnlyList<DistributionType> to_item, IReadOnlyList<DistributionType> item, IReadOnlyList<IReadOnlyList<int>> indices, int resultIndex)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : SettableToProduct<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | result | |
IReadOnlyList<DistributionType> | to_item | |
IReadOnlyList<DistributionType> | item | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
Int32 | resultIndex |
Returns
Type | Description |
---|---|
ArrayType |
Type Parameters
Name | Description |
---|---|
ArrayType | The type of the outgoing message. |
DistributionType | The type of a distribution over array elements. |
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 a message from |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|