Ocronet.Dynamic.OcroFST.BeamSearch.BestPath C# (CSharp) Method

BestPath() public method

public BestPath ( Intarray v1, Intarray v2, Intarray inputs, Intarray outputs, Floatarray costs ) : void
v1 Intarray
v2 Intarray
inputs Intarray
outputs Intarray
costs Floatarray
return void
        public void BestPath(Intarray v1, Intarray v2, Intarray inputs,
                      Intarray outputs, Floatarray costs)
        {
            stree.Clear();

            beam.Resize(1);
            beamcost.Resize(1);
            beam[0] = stree.Add(-1, fst1.GetStart(), fst2.GetStart(), 0, 0, 0);
            beamcost[0] = 0;

            best_so_far = 0;
            best_cost_so_far = fst1.GetAcceptCost(fst1.GetStart()) +
                               fst2.GetAcceptCost(fst1.GetStart());

            while (beam.Length() > 0)
                Radiate();

            stree.Get(v1, v2, inputs, outputs, costs, best_so_far);
            costs.Push(fst1.GetAcceptCost(stree.v1[best_so_far]) +
                       fst2.GetAcceptCost(stree.v2[best_so_far]));

            //logger("costs", costs);
        }

Usage Example

コード例 #1
0
ファイル: BeamSearch.cs プロジェクト: nickun/OCRonet
 public static void beam_search(
         Intarray vertices1,
         Intarray vertices2,
         Intarray inputs,
         Intarray outputs,
         Floatarray costs,
         OcroFST fst1,
         OcroFST fst2,
         int beam_width)
 {
     BeamSearch b = new BeamSearch(fst1, fst2, beam_width);
     //CHECK(L_SIGMA < L_EPSILON);
     //CHECK(L_RHO < L_PHI);
     //CHECK(L_PHI < L_EPSILON);
     //CHECK(L_EPSILON < 1);
     fst1.SortByOutput();
     fst2.SortByInput();
     b.BestPath(vertices1, vertices2, inputs, outputs, costs);
 }
All Usage Examples Of Ocronet.Dynamic.OcroFST.BeamSearch::BestPath