Changes 'next_errors' variable in main decoding loop to a linked list#173
Changes 'next_errors' variable in main decoding loop to a linked list#173dandragona-dev wants to merge 1 commit intoquantumlib:mainfrom
Conversation
47c2eac to
99c1844
Compare
LalehB
left a comment
There was a problem hiding this comment.
Thank you so much @dandragona-dev, this is such a cool optimization! I added a few questions inline, but could you also add a few of your plots to the PR description showing the performance gains you got? (if you have them available, I really liked those plots.)
eaf425b to
6509745
Compare
of errors (linked list) rather than a vector of all errors. Prevents unnecessary vector copies as we can just rebuild the history when we need to. Also use arena allocator to prevent repeated heap allocation.
6509745 to
4a1e64a
Compare
LalehB
left a comment
There was a problem hiding this comment.
LGTM!
Thank you @dandragona-dev
|
This is very cool, thanks! I just have a question about the algorithm. Some error chains may end up dangling because there is no longer any node in the PQ with that chain. This could be due to the beam cutoff, for example. Is this correct? This should be fine in any case because the total amount of memory they consume should be controlled by the pqlimit. Just want to make sure I have the right understanding. |
I believe that sounds correct, but I will say that this PR should not introduce any change to states being explored by Tesseract. For instance, if the current error chain (out of 10) is {1,2,3} and we are considering adding {1,2,3,4}, {1,2,3,5}, ... {1,2,3,8} with the beam cutoff affecting {1,2,3,9} and {1,2,3,10}, then these last two states will be unexplored permanently IIUC (is this what you mean by dangling?). |
Tested with:
Additional accuracy comparisons: