-
-
Notifications
You must be signed in to change notification settings - Fork 567
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
New decoding structure for linear codes #18813
Comments
This comment has been minimized.
This comment has been minimized.
Branch: u/dlucas/decoder |
Commit: |
Dependencies: #18376 |
Author: David Lucas |
This comment has been minimized.
This comment has been minimized.
comment:7
I modified this tickets accordingly with reviewer's remarks in #18376, as these two are quite symmetrical. It's still ready for review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
I merged with latest beta and resolved conflicts. Still pending for review. |
comment:12
I fixed a few things patchbot was complaining about. It'll probably continue to complain on coverage but I don't see the point of adding doctests on a deprecated function so if the reviewer agrees I'm going to ignore this warning. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
I updated to latest beta and fixed the conflicts that arose after that merge. It's ready for review again. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:28
I definitely agree. But these methods were written before me, and all I did here was to make them fit in the new structure. |
comment:29
decoder.py line 184: connectoed -> connected |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:31
Last push fixes all your comments but the last one. I wait for the (potential) other remarks before writing another patch :) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:33
As you just told me it was ok, here's the fix for the typo you noticed. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:35
All my remarks have been addressed. |
Reviewer: cpernet |
Changed reviewer from cpernet to Clément Pernet |
comment:38
Merge conflict, possibly with #16080 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:40
I merged in #16080 and fixed the conflict in |
comment:41
This merge works for me. |
Changed branch from u/dlucas/decoder to |
For now, linear codes don't have a proper structure for decoding, where "decoding" means using an error-correction algorithm to recover the original codeword.
We propose in this ticket a new structure, designed to handle word -> codeword and word -> message transformations.
We provide the following:
An abstract class
Decoder
, for inheritances purposes. EveryDecoder
will inherit from this class. It contains:decode_to_code
anddecode_to_message
default implementation;An exception class
DecodingFailure
, for errors related to decoding algorithms.Methods for decoding handling in
AbstractLinearCode
(see Design)Design
What "Decoding" means depends on the algorithm used to find and correct the errors in a provided word. For instance, there are decoding algorithms able to locate and correct up to a certain amount of errors, and will fail if there is more errors than this bound. Others will return a list of codewords, which contain the original codeword. Some decoding algorithms are probabilistic, some are deterministic.
To describe the variety of behaviours, we introduce a list of "types", called
_decoder_type
which is a set of keywords describing the semantics of the decoding algorithm represented by the class.Decodig usually recovers codewords close to the provided words. Some decoding algorithms, however, naturally decode directly to the message from which the codeword was obtained. This is e.g. the case with the Berlekamp-Welch or the Guruswami-Sudan algorithms. Since both uses are natural and in common use in theory and practice, we provide two different methods: decode_to_code and decode_to_message. The former corrects the errors and return an element from the code, while the latter corrects the errors and returns an element from a message space. Thanks to a default implementation, reimplmenting both is not needed. One only needs to override one of these two methods in a Decoder class, and the default implementation will be used to perform the other one.
As is discussed in #18376, a code can have many message spaces, and the map between a message space and the code is given by an Encoder. The
decode_to_message
will pertain to a certain suchEncoder
, so we introduce the string field_connected_encoder_name
to point to this encoder. A user can acquire the actualEncoder
object by callingDecoder.connected_encoder
.Furthermore, we propose here the exact same structure of registration for decoders as the one we introduced in #18376, and the same handling of it on the level of codes: each code will have a
default_decoder
, so if one does not want to be bothered by multiple decoding algorithms when he just wants to decode a wordy
for his codeC
, all he has to do is to writeC.decode_to_code(y)
, and the default decoder will be used to correct the errors iny
.With this structure, we are able to represent different decoding algorithms for each code, even if they have different behaviour. We also have a versatile structure which allows specific experimentation on chosen decoding algorithms alongside with generic decodings in which the algorithm does not matter.
Notes
This ticket relies on the encoding structure proposed on trac #18376, as every decoder has to be linked with an encoder.
The original decoding algorithms, which were in decoder.py are now in two different
Decoder
objects inlinear_code.py
. I removed the guava one as the call to guava's decoding algorithm returned a guava error.Depends on #18376
CC: @johanrosenkilde @jpflori @videlec @defeo @ClementPernet
Component: coding theory
Author: David Lucas
Branch/Commit:
cf5ac32
Reviewer: Clément Pernet
Issue created by migration from https://trac.sagemath.org/ticket/18813
The text was updated successfully, but these errors were encountered: