From 2f1497b1b87867f8b8c76a7e63ed46e5d3b963a4 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Mon, 7 Nov 2022 11:07:24 +0100 Subject: [PATCH] Comment and formatting changes --- sw/decoders/proximal.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sw/decoders/proximal.py b/sw/decoders/proximal.py index b1f84ae..4265150 100644 --- a/sw/decoders/proximal.py +++ b/sw/decoders/proximal.py @@ -2,13 +2,14 @@ import numpy as np class ProximalDecoder: - """Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes" by Tadashi - Wadayama, and Satoshi Takabe. + """Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes" + by Tadashi Wadayama, and Satoshi Takabe. """ # TODO: How large should K be? # TODO: How large should eta be? # TODO: How large should step_size be? - def __init__(self, H: np.array, K: int = 100, step_size: float = 0.5, gamma: float = 0.05, eta: float = 1.1): + def __init__(self, H: np.array, K: int = 100, step_size: float = 0.5, gamma: float = 0.05, + eta: float = 1.1): """Construct a new ProximalDecoder Object. :param H: Parity Check Matrix @@ -25,7 +26,9 @@ class ProximalDecoder: @staticmethod def _L_awgn(s: np.array, y: np.array) -> np.array: - """Variation of the negative log-likelihood for the special case of AWGN noise. See 4.1, p. 4.""" + """Variation of the negative log-likelihood for the special case of AWGN noise. + See 4.1, p. 4. + """ return s - y # TODO: Is this correct? @@ -84,9 +87,11 @@ class ProximalDecoder: def decode(self, y: np.array) -> np.array: """Decode a received signal. The algorithm is detailed in 3.2, p.3. - This function assumes a BPSK-like modulated signal ([-1, 1]^n instead of [0, 1]^n) and an AWGN channel. + This function assumes a BPSK-like modulated signal ([-1, 1]^n instead of [0, 1]^n) + and an AWGN channel. - :param y: Vector of received values. (y = x + n, where 'x' is element of [-1, 1]^m and 'n' is noise) + :param y: Vector of received values. (y = x + w, where 'x' is element of [-1, 1]^n + and 'w' is noise) :return: Most probably sent symbol """ s = 0