コード例 #1
0
 public static bool TestGraphPaths(TransducerGraph sourceGraph, TransducerGraph testGraph, int numPaths)
 {
     for (int i = 0; i < numPaths; i++)
     {
         IList  path     = sourceGraph.SampleUniformPathFromGraph();
         double score    = sourceGraph.GetOutputOfPathInGraph(path);
         double newScore = testGraph.GetOutputOfPathInGraph(path);
         if ((score - newScore) / (score + newScore) > 1e-10)
         {
             System.Console.Out.WriteLine("Problem: " + score + " vs. " + newScore + " on " + path);
             return(false);
         }
     }
     return(true);
 }