-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Improving Efficiency of LinearCode.NearestNeighborDecoder method #20201
Comments
comment:2
Solution idea: If |
comment:3
Yes, that sounds like a good plan! |
comment:5
I ran some tests, as far as I understood them. It cleared them all. But this is not be ready to merge yet. I thought I would put up a "changes until now" commit. Have I made mistake(s)? New commits:
|
Commit: |
comment:6
Hello, I finally looked at the code, my remarks follow:
Something like:
Oh, and when you finish your work on a ticket, don't forget to set it to Apart from that, I'm fine with your code! David |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
Hello, You made a mistake when declaring the iterator: You should always run the doctests after changing something, as they help you to catch errors of this kind.
This does not cause any trouble here, but I like being specific with exceptions, so I'd rather say
This way, you only Best, David |
comment:10
Actually, that's bad too:
It is nothing but syntactic sugar for instantiating the iterator, but it is much more readable and less prone to programming errors. I have ever only created explicit iterators in very rare cases in Python. |
comment:11
Ah, I see now what you used the iterator for: picking out a first element. However, |
comment:12
Yes, that's what I had in mind when I suggested this. |
comment:13
I'm getting some weird errors when I use those commands you specified. ./sage -br -> This is the problem I'm facing. |
comment:14
It seems to be a problem with compilation in general. Did you try |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
Hello, You have two choices here:
In your latest push, you removed the line creating the iterator, but kept the try/except block which attempts to catch a Pick the one you prefer, and change the rest of the code accordingly. Another remark: if you think your push is ready for review, please set the ticket to Best, David |
comment:17
I was thinking that the first idea is more convenient. The following should suffice, right? c_min = self.code().zero() Also, I was just testing commits after I fixed that pkgconfig error and in that confusion, I forgot to remove the try-except catch. Sorry. |
comment:18
That's fine :) Otherwise, I think the code you suggest is good. Best, David |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: David Lucas |
comment:21
Hello, Tests passes, the code and documentation are good, giving positive review. Best, David |
Changed branch from u/arpitdm/improving_efficiency_of_linearcode_nearestneighbordecoder_method to |
The
decode_to_code
method of the current implementation of theNearestNeighborDecoder
creates and stores the distances between the received word and every codeword. It then sorts the entire list in order to find the closest codeword. This takes asymptotic memory and time in the size of the code which can be very inefficient for large input.This should be improved.
CC: @sagetrac-dlucas @johanrosenkilde
Component: coding theory
Author: Arpit Merchant
Branch/Commit:
febfd7f
Reviewer: David Lucas
Issue created by migration from https://trac.sagemath.org/ticket/20201
The text was updated successfully, but these errors were encountered: