Search Results for

    Show / Hide Table of Contents

    Interface WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.IWeightFunction

    The part of WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.IWeightFunction<TThis> API, that is agnostic of the concrete weight function class. Implementations of closed constructed WeightFunctions<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>.IWeightFunction<TThis> can all be upcasted to this type.

    Namespace: Microsoft.ML.Probabilistic.Distributions.Automata
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [Quality(QualityBand.Experimental)]
    public interface IWeightFunction
    Remarks

    Types implementing this interface must be constant and thread-safe.

    Properties

    IsPointMass

    Gets a value indicating whether the current weight function assigns a non-zero weight to exactly one point.

    Declaration
    bool IsPointMass { get; }
    Property Value
    Type Description
    Boolean

    Point

    Gets the only point to which the current function assigns a non-zero weight.

    Declaration
    TSequence Point { get; }
    Property Value
    Type Description
    TSequence
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when an attempt is made to get the Point of a non-pointmass weight function.

    UsesAutomatonRepresentation

    Gets a value indicating whether the current weight function is represented as an automaton internally.

    Declaration
    bool UsesAutomatonRepresentation { get; }
    Property Value
    Type Description
    Boolean

    UsesGroups

    Checks if the weight function uses groups.

    Declaration
    bool UsesGroups { get; }
    Property Value
    Type Description
    Boolean

    true if the weight function uses groups, false otherwise.

    Methods

    AsAutomaton()

    Returns an automaton representation of the current weight function. If the weight function is normalized, the resulting automaton is stochastic, i.e. the sum of weights of all the outgoing transitions and the ending weight is 1 for every node.

    Declaration
    TAutomaton AsAutomaton()
    Returns
    Type Description
    TAutomaton

    EnumeratePaths()

    Enumerates paths through this weight function.

    Declaration
    IEnumerable<Tuple<List<TElementDistribution>, double>> EnumeratePaths()
    Returns
    Type Description
    IEnumerable<Tuple<List<TElementDistribution>, Double>>

    The paths through this weight function, with their log weights

    EnumerateSupport(Int32)

    Enumerates support of this weight function when possible.

    Declaration
    IEnumerable<TSequence> EnumerateSupport(int maxCount = 1000000)
    Parameters
    Type Name Description
    Int32 maxCount

    The maximum support enumeration count.

    Returns
    Type Description
    IEnumerable<TSequence>

    The sequences in the support of this weight function

    Exceptions
    Type Condition
    AutomatonEnumerationCountException

    Thrown if enumeration is too large.

    GetLogNormalizer()

    Computes the logarithm of the normalizer (sum of values of the weight function on all sequences).

    Declaration
    double GetLogNormalizer()
    Returns
    Type Description
    Double

    The logarithm of the normalizer.

    Remarks

    Returns PositiveInfinity if the sum diverges.

    GetLogValue(TSequence)

    Computes the logarithm of the value of the weight function on a given sequence.

    Declaration
    double GetLogValue(TSequence sequence)
    Parameters
    Type Name Description
    TSequence sequence

    The sequence to compute the value on.

    Returns
    Type Description
    Double

    The logarithm of the value.

    HasGroup(Int32)

    Determines whether this weight function has the specified group (if applicable).

    Declaration
    bool HasGroup(int group)
    Parameters
    Type Name Description
    Int32 group

    The specified group.

    Returns
    Type Description
    Boolean

    True if it the weight function has this group, false otherwise.

    IsZero()

    Checks whether the current weight function is zero on all sequences.

    Declaration
    bool IsZero()
    Returns
    Type Description
    Boolean

    true if the current weight function is zero on all sequences, false otherwise.

    ToString(Action<TElementDistribution, StringBuilder>)

    Returns a string that represents the weight function.

    Declaration
    string ToString(Action<TElementDistribution, StringBuilder> appendElement)
    Parameters
    Type Name Description
    Action<TElementDistribution, StringBuilder> appendElement

    Optional method for appending at the element distribution level.

    Returns
    Type Description
    String

    A string that represents the weight function.

    TryEnumerateSupport(Int32, out IEnumerable<TSequence>)

    Tries to enumerate support of this weight function.

    Declaration
    bool TryEnumerateSupport(int maxCount, out IEnumerable<TSequence> result)
    Parameters
    Type Name Description
    Int32 maxCount

    The maximum support enumeration count.

    IEnumerable<TSequence> result

    The sequences in the support of this weight function

    Returns
    Type Description
    Boolean

    True if successful, false otherwise

    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.