Difference: RandEquivalentDoc (1 vs. 2)

Revision 22014-04-23 - MichaelRiley

Line: 1 to 1
 
META TOPICPARENT name="FstQuickTour"

RandEquivalent

Line: 48 to 48
 
LogProbArcSelector 10 true
1000000 false
Changed:
<
<
-- CyrilAllauzen - 27 Mar 2009
>
>

See Also

Equal, Equivalent, Isomorphic

 
META FILEATTACHMENT attachment="randequiv1.png" attr="" comment="!RandEquivalent: first input FST" date="1238185032" name="randequiv1.png" path="randequiv1.png" size="11594" stream="randequiv1.png" tmpFilename="/var/tmp/CGItemp17052" user="CyrilAllauzen" version="4"
META FILEATTACHMENT attachment="randequiv2.png" attr="" comment="!RandEquivalent: second input FST" date="1238186339" name="randequiv2.png" path="randequiv2.png" size="11414" stream="randequiv2.png" tmpFilename="/var/tmp/CGItemp16929" user="CyrilAllauzen" version="3"

Revision 12009-03-27 - CyrilAllauzen

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FstQuickTour"

RandEquivalent

Description

This operation test is two FSTs are equivalent by randomly generating N paths alternatively in each of the two FSTs.

For each randomly generated path, the algorithm computes for each of the two FSTs the sum of the weights of all the successful paths sharing the same input and output labels as the considered randomly generated path and checks that these two values are within 'delta'.

The random generation can be specified in the same as for the RandGen operation.

Usage

template <class Arc>
bool RandEquivalent(const Fst<Arc> &fst1, const Fst<Arc> &fst2,
                    ssize_t num_paths, float delta = kDelta,
                    int seed = time(0), int path_length = INT_MAX);
doc [bad link?]
template<class Arc, class ArcSelector>
bool RandEquivalent(const Fst<Arc> &fst1, const Fst<Arc> &fst2,
                    ssize_t num_paths, float delta,
                    const RandGenOptions<ArcSelector> &opts);
fstequivalent --random [-npath=$n] [--delta=$delta] [--seed=$seed] [--max_length=$max_length] in1.fst in2.fst
 

Example

A B
randequiv1.png randequiv2.png

RandEquivalent(A, B, npaths, kDelta, RandGenOptions<ArcSelector>());

fstequivalent --random --npath=$npaths a.fst b.fst

ArcSelector npaths RandEquivalent(A, B)
UniformArcSelector 10 false
LogProbArcSelector 10 true
1000000 false

-- CyrilAllauzen - 27 Mar 2009

META FILEATTACHMENT attachment="randequiv1.png" attr="" comment="!RandEquivalent: first input FST" date="1238185032" name="randequiv1.png" path="randequiv1.png" size="11594" stream="randequiv1.png" tmpFilename="/var/tmp/CGItemp17052" user="CyrilAllauzen" version="4"
META FILEATTACHMENT attachment="randequiv2.png" attr="" comment="!RandEquivalent: second input FST" date="1238186339" name="randequiv2.png" path="randequiv2.png" size="11414" stream="randequiv2.png" tmpFilename="/var/tmp/CGItemp16929" user="CyrilAllauzen" version="3"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback