Class JaggedSubarrayWithMarginalOp<T>
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Collection), "JaggedSubarrayWithMarginal<>", new Type[]{}, Default = true)]
[Quality(QualityBand.Preview)]
public static class JaggedSubarrayWithMarginalOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of an array item. |
Methods
ArrayAverageConditional<ArrayType>(ArrayType, ArrayType, ArrayType)
EP message to array
.
Declaration
public static ArrayType ArrayAverageConditional<ArrayType>(ArrayType array, [SkipIfAllUniform] ArrayType to_marginal, ArrayType result)
where ArrayType : SettableToRatio<ArrayType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | Incoming message from |
ArrayType | to_marginal | Previous outgoing message to |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of the outgoing message. |
Remarks
The outgoing message is the factor viewed as a function of array
conditioned on the given values.
ArrayAverageConditional<DistributionType, ArrayType, ItemType>(IReadOnlyList<IReadOnlyList<Int32>>, IList<ItemType>, ArrayType)
EP message to array
.
Declaration
public static ArrayType ArrayAverageConditional<DistributionType, ArrayType, ItemType>(IReadOnlyList<IReadOnlyList<int>> indices, IList<ItemType> items, ArrayType result)
where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
IList<ItemType> | items | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ItemType | The type of a sub-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_(indices,items) p(indices,items) factor(items,array,indices,marginal)]/p(array)
.
ArrayAverageLogarithm<DistributionType, ArrayType, ItemType>(IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
VMP message to array
.
Declaration
public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType, ItemType>([SkipIfAllUniform] IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where DistributionType : SettableToUniform, SettableToProduct<DistributionType> where ArrayType : IList<DistributionType>, SettableToUniform where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | Incoming message from |
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ItemType | The type of a sub-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) p(indices) log(sum_items p(items) factor(items,array,indices,marginal)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ArrayAverageLogarithm<DistributionType, ArrayType, ItemType>(IReadOnlyList<IReadOnlyList<Int32>>, IList<ItemType>, ArrayType)
VMP message to array
.
Declaration
public static ArrayType ArrayAverageLogarithm<DistributionType, ArrayType, ItemType>(IReadOnlyList<IReadOnlyList<int>> indices, IList<ItemType> items, ArrayType result)
where DistributionType : HasPoint<T> where ArrayType : IList<DistributionType>, SettableToUniform where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
IList<ItemType> | items | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ArrayType | The type of the outgoing message. |
ItemType | The type of a sub-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) p(indices) log(sum_items p(items) factor(items,array,indices,marginal)))
.
AverageLogFactor<ItemType>(IList<ItemType>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<ItemType>(IList<ItemType> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
AverageLogFactor<DistributionType, ItemType>(IList<ItemType>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType, ItemType>(IList<ItemType> items, IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | 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. |
ItemType | The type of a sub-array. |
AverageLogFactor<DistributionType, ItemType>(IList<ItemType>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType, ItemType>(IList<ItemType> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : CanGetLogProb<T> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | 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. |
ItemType | The type of a sub-array. |
AverageLogFactor<DistributionType, ItemType>(IReadOnlyList<DistributionType>, IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double AverageLogFactor<DistributionType, ItemType>(IReadOnlyList<DistributionType> array, IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T> where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IList<ItemType> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
ItemsAverageConditional<ArrayType, DistributionType, ItemType>(ItemType, ArrayType, ArrayType, IReadOnlyList<IReadOnlyList<Int32>>, Int32, ItemType)
EP message to items
.
Declaration
public static ItemType ItemsAverageConditional<ArrayType, DistributionType, ItemType>(ItemType items, ArrayType array, [SkipIfAllUniform] ArrayType to_marginal, IReadOnlyList<IReadOnlyList<int>> indices, int resultIndex, ItemType result)
where ArrayType : IList<DistributionType> where DistributionType : SettableToProduct<DistributionType>, SettableToRatio<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ItemType | items | Incoming message from |
ArrayType | array | Incoming message from |
ArrayType | to_marginal | Previous outgoing message to |
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,marginal)]/p(items)
.
ItemsAverageLogarithm<DistributionType, ItemType, ResultType>(IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>, ResultType)
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 | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
ResultType | result |
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. |
LogAverageFactor<ItemType>(IList<ItemType>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<ItemType>(IList<ItemType> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
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. |
LogAverageFactor<DistributionType, ItemType>(IList<ItemType>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<DistributionType, ItemType>(IList<ItemType> items, IReadOnlyList<DistributionType> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, SettableToProduct<DistributionType>, CanGetLogAverageOf<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | 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. |
ItemType | The type of a sub-array. |
LogAverageFactor<DistributionType, ItemType>(IReadOnlyList<DistributionType>, IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogAverageFactor<DistributionType, ItemType>(IReadOnlyList<DistributionType> array, IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T> where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IList<ItemType> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
LogEvidenceRatio<ItemType>(IList<ItemType>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogEvidenceRatio<ItemType>(IList<ItemType> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | items | |
IReadOnlyList<T> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
ItemType | The type of a sub-array. |
LogEvidenceRatio<DistributionType>(IReadOnlyList<IReadOnlyList<DistributionType>>, IReadOnlyList<DistributionType>, IReadOnlyList<IReadOnlyList<Int32>>, IReadOnlyList<IReadOnlyList<DistributionType>>)
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 | |
IReadOnlyList<DistributionType> | array | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | |
IReadOnlyList<IReadOnlyList<DistributionType>> | to_items |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
LogEvidenceRatio<DistributionType, ItemType>(IList<ItemType>, IReadOnlyList<T>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogEvidenceRatio<DistributionType, ItemType>(IList<ItemType> items, IReadOnlyList<T> array, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : CanGetLogProb<T> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
IList<ItemType> | 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. |
ItemType | The type of a sub-array. |
LogEvidenceRatio<DistributionType, ItemType>(IReadOnlyList<DistributionType>, IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>)
Declaration
public static double LogEvidenceRatio<DistributionType, ItemType>(IReadOnlyList<DistributionType> array, IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices)
where DistributionType : IDistribution<T>, CanGetLogProb<T> where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<DistributionType> | array | |
IList<ItemType> | items | |
IReadOnlyList<IReadOnlyList<Int32>> | indices |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
MarginalAverageConditional<ArrayType, DistributionType, ItemType>(ArrayType, IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
Declaration
[SkipIfAllUniform(new string[]{"array", "items"})]
public static ArrayType MarginalAverageConditional<ArrayType, DistributionType, ItemType>(ArrayType array, IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : SettableToProduct<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | |
IList<ItemType> | 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. |
ItemType | The type of a sub-array. |
MarginalAverageConditional<ArrayType, DistributionType, ItemArrayType, ItemType>(ArrayType, IList<ItemType>, IReadOnlyList<IReadOnlyList<Int32>>, ArrayType)
Declaration
[SkipIfAllUniform(new string[]{"array", "items"})]
public static ArrayType MarginalAverageConditional<ArrayType, DistributionType, ItemArrayType, ItemType>(ArrayType array, IList<ItemType> items, IReadOnlyList<IReadOnlyList<int>> indices, ArrayType result)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : HasPoint<T> where ItemType : IList<T>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | |
IList<ItemType> | 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. |
ItemArrayType | The type of an incoming message from |
ItemType | The type of a sub-array. |
MarginalAverageLogarithm<ArrayType>(ArrayType, ArrayType)
VMP message to marginal
.
Declaration
public static ArrayType MarginalAverageLogarithm<ArrayType>(ArrayType array, ArrayType result)
where ArrayType : SettableTo<ArrayType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | Incoming message from |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of the outgoing message. |
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except marginal
. The formula is exp(sum_(array) p(array) log(factor(items,array,indices,marginal)))
.
MarginalIncrementArray<ArrayType>(ArrayType, ArrayType, ArrayType)
Declaration
public static ArrayType MarginalIncrementArray<ArrayType>(ArrayType array, ArrayType to_array, ArrayType result)
where ArrayType : SettableToProduct<ArrayType>
Parameters
Type | Name | Description |
---|---|---|
ArrayType | array | Incoming message from |
ArrayType | to_array | Previous outgoing message to |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of the outgoing message. |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
MarginalIncrementItems<ArrayType, DistributionType, ItemType>(ItemType, ItemType, IReadOnlyList<IReadOnlyList<Int32>>, Int32, ArrayType)
Declaration
public static ArrayType MarginalIncrementItems<ArrayType, DistributionType, ItemType>(ItemType item, ItemType to_item, IReadOnlyList<IReadOnlyList<int>> indices, int resultIndex, ArrayType result)
where ArrayType : IList<DistributionType>, SettableTo<ArrayType> where DistributionType : SettableToProduct<DistributionType> where ItemType : IList<DistributionType>
Parameters
Type | Name | Description |
---|---|---|
ItemType | item | |
ItemType | to_item | |
IReadOnlyList<IReadOnlyList<Int32>> | indices | Incoming message from |
Int32 | resultIndex | Index of the |
ArrayType | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
ArrayType |
|
Type Parameters
Name | Description |
---|---|
ArrayType | The type of the outgoing message. |
DistributionType | The type of a distribution over array elements. |
ItemType | The type of a sub-array. |
Remarks