Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in bottom-up algorithm #1

Open
seekinglambda opened this issue Dec 14, 2016 · 1 comment
Open

Bug in bottom-up algorithm #1

seekinglambda opened this issue Dec 14, 2016 · 1 comment

Comments

@seekinglambda
Copy link

seekinglambda commented Dec 14, 2016

Bottom-up algorithm contains a bug that causes it to underperform severely unless max error is very low. Bug was caused by some kind of offset error with mergesegments array. I changed the function as follows to solve it:

while min(mergecosts) < max_error:
        idx = mergecosts.index(min(mergecosts))

        new_seg = create_segment(sequence, (segments[idx][0], segments[idx+1][2]))
        segments[idx] = new_seg
        del segments[idx+1]


        if idx > 0:
            merge_seg = create_segment(sequence,(segments[idx-1][0],segments[idx][2]))
            mergecosts[idx-1] = compute_error(sequence,merge_seg)

        if idx+1 < len(mergecosts):
            merge_seg = create_segment(sequence,(segments[idx][0],segments[idx+1][2]))
            mergecosts[idx] = compute_error(sequence,merge_seg)

        del mergecosts[idx]

    return segments
@h-kouame
Copy link

I second this bug report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants