Class DiscreteEnum<TEnum>
A discrete distribution over the values of an enum.
Implements
IDistribution<TEnum>
HasPoint<TEnum>
CanGetLogProb<TEnum>
SettableTo<DiscreteEnum<TEnum>>
SettableToProduct<DiscreteEnum<TEnum>>
SettableToRatio<DiscreteEnum<TEnum>>
SettableToPower<DiscreteEnum<TEnum>>
SettableToWeightedSum<DiscreteEnum<TEnum>>
SettableToPartialUniform<DiscreteEnum<TEnum>>
CanGetLogAverageOf<DiscreteEnum<TEnum>>
CanGetLogAverageOfPower<DiscreteEnum<TEnum>>
CanGetAverageLog<DiscreteEnum<TEnum>>
Sampleable<TEnum>
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Quality(QualityBand.Preview)]
public class DiscreteEnum<TEnum> : GenericDiscreteBase<TEnum, DiscreteEnum<TEnum>>, IDistribution<TEnum>, IDistribution, ICloneable, Diffable, SettableToUniform, HasPoint<TEnum>, CanGetLogProb<TEnum>, SettableTo<DiscreteEnum<TEnum>>, SettableToProduct<DiscreteEnum<TEnum>>, SettableToProduct<DiscreteEnum<TEnum>, DiscreteEnum<TEnum>>, SettableToRatio<DiscreteEnum<TEnum>>, SettableToRatio<DiscreteEnum<TEnum>, DiscreteEnum<TEnum>>, SettableToPower<DiscreteEnum<TEnum>>, SettableToWeightedSumExact<DiscreteEnum<TEnum>>, SettableToWeightedSum<DiscreteEnum<TEnum>>, SettableToPartialUniform<DiscreteEnum<TEnum>>, CanGetLogAverageOf<DiscreteEnum<TEnum>>, CanGetLogAverageOfPower<DiscreteEnum<TEnum>>, CanGetAverageLog<DiscreteEnum<TEnum>>, Sampleable<TEnum>
Type Parameters
Name | Description |
---|---|
TEnum |
Constructors
DiscreteEnum()
Creates a uniform distribution over the enum values.
Declaration
public DiscreteEnum()
DiscreteEnum(Vector)
Creates a distribution over the enum values using the specified probabilities.
Declaration
public DiscreteEnum(Vector probs)
Parameters
Type | Name | Description |
---|---|---|
Vector | probs |
DiscreteEnum(Double[])
Creates a distribution over the enum values using the specified probabilities.
Declaration
public DiscreteEnum(params double[] probs)
Parameters
Type | Name | Description |
---|---|---|
Double[] | probs |
Methods
ConvertFromInt(Int32)
Converts from an integer to an enum value
Declaration
public override TEnum ConvertFromInt(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i |
Returns
Type | Description |
---|---|
TEnum |
Overrides
Microsoft.ML.Probabilistic.Distributions.GenericDiscreteBase<TEnum, Microsoft.ML.Probabilistic.Distributions.DiscreteEnum<TEnum>>.ConvertFromInt(System.Int32)
ConvertToInt(TEnum)
Converts the enum value to an integer
Declaration
public override int ConvertToInt(TEnum value)
Parameters
Type | Name | Description |
---|---|---|
TEnum | value |
Returns
Type | Description |
---|---|
Int32 |
Overrides
Microsoft.ML.Probabilistic.Distributions.GenericDiscreteBase<TEnum, Microsoft.ML.Probabilistic.Distributions.DiscreteEnum<TEnum>>.ConvertToInt(TEnum)