Class ReplicateGibbsOp<T>
Provides outgoing messages for the following factors:
, given random arguments to the function.Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Clone), "Replicate<>", new Type[]{}, Default = true)]
[FactorMethod(typeof(Clone), "ReplicateWithMarginal<>", new Type[]{}, Default = true)]
[Quality(QualityBand.Mature)]
public static class ReplicateGibbsOp<T>
Type Parameters
Name | Description |
---|---|
T | The type of the variable being replicated. |
Methods
DefGibbs<TDist>(TDist[], TDist)
Declaration
public static TDist DefGibbs<TDist>([SkipIfAllUniform] TDist[] Uses, TDist result)
where TDist : IDistribution<T>, Sampleable<T>, SettableToProduct<TDist>, SettableTo<TDist>
Parameters
Type | Name | Description |
---|---|---|
TDist[] | Uses | Incoming message from |
TDist | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDist |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
DefGibbs<TDist>(GibbsMarginal<TDist, T>, T)
Declaration
public static T DefGibbs<TDist>(GibbsMarginal<TDist, T> to_marginal, T result)
where TDist : IDistribution<T>, Sampleable<T>
Parameters
Type | Name | Description |
---|---|---|
GibbsMarginal<TDist, T> | to_marginal | |
T | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
DefGibbs<TDist>(IReadOnlyList<TDist>, TDist)
Declaration
public static TDist DefGibbs<TDist>([SkipIfAllUniform] IReadOnlyList<TDist> Uses, TDist result)
where TDist : IDistribution<T>, Sampleable<T>, SettableTo<TDist>, SettableToProduct<TDist>, SettableToRatio<TDist>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<TDist> | Uses | |
TDist | result |
Returns
Type | Description |
---|---|
TDist |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
GibbsEvidence<TDist>(IList<TDist>, T)
Declaration
public static double GibbsEvidence<TDist>(IList<TDist> Uses, T Def)
where TDist : IDistribution<T>
Parameters
Type | Name | Description |
---|---|---|
IList<TDist> | Uses | Incoming message from |
T | Def | Incoming message from |
Returns
Type | Description |
---|---|
Double |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
LogEvidenceRatio<TDist>(IList<TDist>, T)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio<TDist>([SkipIfAllUniform] IList<TDist> Uses, T Def)
where TDist : IDistribution<T>
Parameters
Type | Name | Description |
---|---|---|
IList<TDist> | Uses | Incoming message from |
T | Def | Incoming message from |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
The formula for the result is log(sum_(Uses,Def) p(Uses,Def) factor(Uses,Def,Count) / sum_Uses p(Uses) messageTo(Uses))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
MarginalGibbs<TDist>(IReadOnlyList<TDist>, TDist, GibbsMarginal<TDist, T>)
Declaration
[SkipIfAllUniform]
public static GibbsMarginal<TDist, T> MarginalGibbs<TDist>(IReadOnlyList<TDist> Uses, TDist Def, GibbsMarginal<TDist, T> to_marginal)
where TDist : IDistribution<T>, SettableToProduct<TDist>, SettableToRatio<TDist>, SettableTo<TDist>, Sampleable<T>
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<TDist> | Uses | |
TDist | Def | |
GibbsMarginal<TDist, T> | to_marginal |
Returns
Type | Description |
---|---|
GibbsMarginal<TDist, T> |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
MarginalGibbs<TDist, TDomain>(TDomain, GibbsMarginal<TDist, TDomain>)
Declaration
public static GibbsMarginal<TDist, TDomain> MarginalGibbs<TDist, TDomain>(TDomain Def, GibbsMarginal<TDist, TDomain> to_marginal)
where TDist : IDistribution<TDomain>, Sampleable<TDomain>
Parameters
Type | Name | Description |
---|---|---|
TDomain | Def | |
GibbsMarginal<TDist, TDomain> | to_marginal |
Returns
Type | Description |
---|---|
GibbsMarginal<TDist, TDomain> |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
TDomain | The domain type of |
MarginalGibbs2<TDist>(T[], GibbsMarginal<TDist, T>)
Declaration
public static GibbsMarginal<TDist, T> MarginalGibbs2<TDist>(T[] Uses, GibbsMarginal<TDist, T> to_marginal)
where TDist : IDistribution<T>, Sampleable<T>
Parameters
Type | Name | Description |
---|---|---|
T[] | Uses | |
GibbsMarginal<TDist, T> | to_marginal |
Returns
Type | Description |
---|---|
GibbsMarginal<TDist, T> |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
MarginalGibbsInit<TDist>(TDist)
Declaration
public static GibbsMarginal<TDist, T> MarginalGibbsInit<TDist>(TDist def)
where TDist : IDistribution<T>, Sampleable<T>
Parameters
Type | Name | Description |
---|---|---|
TDist | def | Incoming message from |
Returns
Type | Description |
---|---|
GibbsMarginal<TDist, T> |
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
UsesGibbs(T, Int32, T)
Declaration
public static T UsesGibbs(T def, int resultIndex, T result)
Parameters
Type | Name | Description |
---|---|---|
T | def | Incoming message from |
Int32 | resultIndex | Index of the |
T | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
T |
|
Remarks
UsesGibbs<TDist>(TDist, Int32, TDist)
Declaration
public static TDist UsesGibbs<TDist>(TDist def, int resultIndex, TDist result)
where TDist : IDistribution<T>
Parameters
Type | Name | Description |
---|---|---|
TDist | def | Incoming message from |
Int32 | resultIndex | Index of the |
TDist | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
TDist |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks
UsesGibbs<TDist>(GibbsMarginal<TDist, T>, TDist, Int32, T)
Declaration
public static T UsesGibbs<TDist>(GibbsMarginal<TDist, T> to_marginal, TDist def, int resultIndex, T result)
where TDist : IDistribution<T>, Sampleable<T>
Parameters
Type | Name | Description |
---|---|---|
GibbsMarginal<TDist, T> | to_marginal | |
TDist | def | Incoming message from |
Int32 | resultIndex | Index of the |
T | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
TDist | The type of the distribution over the replicated variable. |
Remarks