Class WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>.Factory
An WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.IWeightFunctionFactory<TWeightFunction> implementation for WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions.Automata
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class Factory : WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.IWeightFunctionFactory<WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>>
Methods
ConstantLog(Double, TElementDistribution)
Creates a weight function which maps every allowed sequence to a given value and maps all other sequences to zero. A sequence is allowed if all its elements have non-zero probability under a given distribution.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> ConstantLog(double logValue, TElementDistribution allowedElements)
Parameters
Type | Name | Description |
---|---|---|
Double | logValue | The logarithm of the value to map every sequence to. |
TElementDistribution | allowedElements | The distribution representing allowed sequence elements. |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created weight function |
ConstantOnSupportOfLog(Double, WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>)
Creates a weight function constant on the support of a given weight function.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> ConstantOnSupportOfLog(double logValue, WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> weightFunction)
Parameters
Type | Name | Description |
---|---|---|
Double | logValue | The logarithm of the desired value on the support of |
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | weightFunction |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created weight function |
Exceptions
Type | Condition |
---|---|
NotImplementedException | Thrown if if the |
FromAutomaton(TAutomaton)
Creates a weight function that is equal to the provided automaton on all sequences.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> FromAutomaton(TAutomaton automaton)
Parameters
Type | Name | Description |
---|---|---|
TAutomaton | automaton | An automaton defining the weight function. |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created point mass weight function. |
FromValues(IEnumerable<KeyValuePair<TSequence, Double>>)
Creates a weight function that assigns provided weights to provided sequences and zero weights to all other sequnces.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> FromValues(IEnumerable<KeyValuePair<TSequence, double>> sequenceWeightPairs)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<TSequence, Double>> | sequenceWeightPairs | Pairs of sequences and corresponding weights |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created point mass weight function. |
PointMass(TSequence)
Creates a point mass weight function.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> PointMass(TSequence point)
Parameters
Type | Name | Description |
---|---|---|
TSequence | point | The point. |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created point mass weight function. |
Sum(IEnumerable<WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>>)
Computes the sum of given weight functions.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> Sum(IEnumerable<WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary>> weightFunctions)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<WeightFunctions.MultiRepresentationWeightFunction<TDictionary>> | weightFunctions |
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The sum of the given weight functions |
Zero()
Creates a weight function which is zero everywhere.
Declaration
public WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.MultiRepresentationWeightFunction<TDictionary> Zero()
Returns
Type | Description |
---|---|
WeightFunctions.MultiRepresentationWeightFunction<TDictionary> | The created weight function |