Fix homotopy definition; Fix simulation results

This commit is contained in:
Andreas Tsouchlos 2025-05-12 23:06:02 +02:00
parent 1499c65525
commit 4b3d39e605
2 changed files with 260 additions and 208 deletions

View File

@ -4,7 +4,7 @@ all:
latexmk src/2024-12-03/presentation.tex
mv build/presentation.pdf build/presentation_2024-12-03.pdf
latexmk src/2025-01-07/presentation.tex
mv build/presentation.pdf build/presentation_2025-01-07.pdf
latexmk src/2025-03-28/presentation.tex
mv build/presentation.pdf build/presentation_2025-03-28.pdf
clean:
rm -rf build

View File

@ -9,7 +9,6 @@
\pgfplotsset{compat=newest}
\usepgfplotslibrary{fillbetween}
\usepackage{listings}
\usepackage{subcaption}
\usepackage{bbm}
@ -22,27 +21,23 @@
%\definecolor{gruvbox-bg}{HTML}{282828}
\definecolor{gruvbox-bg}{HTML}{f2e5bc}
%
%
% Custom commands
%
%
\input{lib/latex-common/common.tex}
\pgfplotsset{colorscheme/rocket}
\newcommand{\res}{src/2025-03-28/res}
%
%
% CEL Template
%
%
\newcommand{\templates}{lib/cel-template}
\input{\templates/packages.tex}
@ -62,44 +57,38 @@
% \AtBeginSubsubsection[]{}
% \AtBeginSubsection[]{}
%
%
% Set up document
%
%
\title{HiWi Notes: Minimization of the Code Constraint Polynomial using
Homotopy Continuation Methods}
\subtitle{\small 07.01.2025}
Homotopy Continuation Methods}
\subtitle{\small 28.03.2025}
\author{\vspace{1.5mm} Andreas Tsouchlos}
\date{ }
\institute{Karlsruhe Institute of Technology (KIT),
\\ Communications Engineering Lab (CEL) }
\\ Communications Engineering Lab (CEL) }
\tikzstyle{every node}=[font=\small]
\captionsetup[sub]{font=small}
%
%
% Document body
%
%
\begin{document}
\begin{frame}[plain]
\maketitle
\end{frame}
\newcommand{\largecitereference}[1]
{\textcolor{kit-green100}{ \large \textbf{{[#1]}} }}
{\textcolor{kit-green100}{ \large \textbf{{[#1]}} }}
%
% - The decoding problem as the search for a solution of polynomial system
@ -108,7 +97,6 @@
% - Implementation
%
% TODO: Check example homotopy
% TODO: Add the name of the homotopy construction (t-1)G + tF and note that it
% is not the only possibility
@ -117,18 +105,26 @@
\begin{minipage}[c]{0.65\textwidth}
\begin{itemize}
\item Goal: Solve system of equations $F(\bm{x}) = \bm{0}, \hspace{2mm} F:\mathbb{R}^n \rightarrow \mathbb{R}^n$
\item Problem: Depending on $F$, solving this directly may be difficult
\item Goal: Solve system of equations $F(\bm{x}) = \bm{0},
\hspace{2mm} F:\mathbb{R}^n \rightarrow \mathbb{R}^n$
\item Problem: Depending on $F$, solving this directly
may be difficult
\item Solution: Define \emph{homotopy function} $H(\bm{x}, t)$ with
\begin{gather*}
H(\bm{x}, 0) = G(\bm{x}), \hspace{5mm} H(\bm{x}, 1) = F(\bm{x})
,\end{gather*}
i.e., a deformation between two systems $G(\bm{x})$ and $F(\bm{x})$
H(\bm{x}, 0) = G(\bm{x}), \hspace{5mm} H(\bm{x},
1) = F(\bm{x})
,
\end{gather*}
i.e., a deformation between two systems $G(\bm{x})$
and $F(\bm{x})$
(where the zeros of $G$ can be easily obtained); E.g.,
\begin{gather*}
H(\bm{x}, t) = (t-1)G(\bm{x}) + tF(\bm{x})
.\end{gather*}
Then, compute $(\bm{x}_0, 0)$ such that $G(\bm{x}_0) = \bm{0}$ and trace path to $(\bm{x}_1, 1)$ with $F(\bm{x}_1) = \bm{0}$
.
\end{gather*}
Then, compute $(\bm{x}_0, 0)$ such that $G(\bm{x}_0) =
\bm{0}$ and trace path to $(\bm{x}_1, 1)$ with
$F(\bm{x}_1) = \bm{0}$
\end{itemize}
\vspace{5mm}
@ -266,7 +262,6 @@
\end{minipage}
\end{frame}
\begin{frame}
\frametitle{Path Tracing}
@ -275,10 +270,13 @@
\begin{itemize}
\item Reminder: We are trying to trace the solution curve
$H(\bm{x}, t) = \bm{0}$ from $t = 0$ to $t = 1$
\item We can express the solution curve as a system of differential equations \citereference{CL15}:
\item We can express the solution curve as a system of
differential equations \citereference{CL15}:
\begin{align*}
DH(\bm{y}(s))\cdot \dot{\bm{y}}(s) &= 0 \\
\text{det}\left(\begin{array}{c} DH(\bm{y}(s)) \\ \dot{\bm{y}}(s)\end{array}\right) &= \sigma_0 \\
\text{det}\left(
\begin{array}{c} DH(\bm{y}(s)) \\ \dot{\bm{y}}(s)
\end{array}\right) &= \sigma_0 \\
\lVert \dot{\bm{y}}(s) \rVert &= 1 \\
\bm{y}(0) &= (\bm{x}_0, 0)
,%
@ -290,8 +288,11 @@
predictor-corrector scheme, e.g., Euler's predictor and Newton's
corrector \citereference{CL15}:
\begin{align*}
\hat{\bm{y}} &= \bm{y}_0 + \Delta s \cdot \sigma \cdot {\bm{y}}(\bm{s})\\
\bm{y} &= \mathcal{N}^k(\hat{\bm{y}}), \hspace{5mm} \mathcal{N}(\hat{\bm{y}}) := \hat{\bm{y}} - (DH(\hat{\bm{y}}))^{+} H(\hat{\bm{y}})
\hat{\bm{y}} &= \bm{y}_0 + \Delta s \cdot \sigma \cdot
{\bm{y}}(\bm{s})\\
\bm{y} &= \mathcal{N}^k(\hat{\bm{y}}), \hspace{5mm}
\mathcal{N}(\hat{\bm{y}}) := \hat{\bm{y}} -
(DH(\hat{\bm{y}}))^{+} H(\hat{\bm{y}})
.%
\end{align*}
\end{itemize}
@ -304,7 +305,6 @@
\stopreferences
\end{frame}
\begin{frame}
\frametitle{Channel Decoding and Polynomial Equations}
@ -314,36 +314,49 @@
\item To describe the decoding problem we can use the code constraint
polynomial \citereference{WT22}
\begin{align*}
%h(\bm{x}) = \underbrace{\sum_{i=1}^{n}\left(1-x_i^2\right)^2}_{\text{Bipolar constraint}} + \underbrace{\sum_{j=1}^{m}\left(1 - \left(\prod_{i\in A(j)}x_i\right)\right)^2}_{\text{Parity constraint}}
h(\bm{x}) = \sum_{i=1}^{n}\left(1-x_i^2\right)^2 + \sum_{j=1}^{m}\left(1 - \left(\prod_{i\in A(j)}x_i\right)\right)^2
%h(\bm{x}) =
% \underbrace{\sum_{i=1}^{n}\left(1-x_i^2\right)^2}_{\text{Bipolar
% constraint}} + \underbrace{\sum_{j=1}^{m}\left(1 -
% \left(\prod_{i\in
% A(j)}x_i\right)\right)^2}_{\text{Parity constraint}}
h(\bm{x}) = \sum_{i=1}^{n}\left(1-x_i^2\right)^2 +
\sum_{j=1}^{m}\left(1 - \left(\prod_{i\in
A(j)}x_i\right)\right)^2
.%
\end{align*}
where $A(j) = \left\{i \in [1:n]: \bm{H}_{j,i} = 1\right\}, \hspace{3mm} j\in [1:m]$
where $A(j) = \left\{i \in [1:n]: \bm{H}_{j,i} = 1\right\},
\hspace{3mm} j\in [1:m]$
represents the set of variables involved in parity check $j$.
\item In a similar vein, we can define a polynomial system whose zeros
correspond to codewords as
\begin{align*}
F(\bm{x}) = \left[\begin{array}{c}1 - x_1^2 \\ \vdots\\ 1 - x_n^2 \\ 1 - \prod_{i \in A(1)}x_i \\ \vdots\\ 1 - \prod_{i \in A(m)}x_i\end{array}\right] \overset{!}{=} \bm{0}
F(\bm{x}) = \left[
\begin{array}{c}1 - x_1^2 \\ \vdots\\ 1 - x_n^2 \\ 1 -
\prod_{i \in A(1)}x_i \\ \vdots\\ 1 -
\prod_{i \in A(m)}x_i
\end{array}\right] \overset{!}{=} \bm{0}
.%
\end{align*}
\end{itemize}
\addreferences
{WT22}{Tadashi Wadayama; Satoshi Takabe: Proximal Decoding for LDPC Codes. IEICE Transactions on Fundamentals of Electronics, Communi-
{WT22}{Tadashi Wadayama; Satoshi Takabe: Proximal Decoding for LDPC
Codes. IEICE Transactions on Fundamentals of Electronics, Communi-
cations and Computer Sciences advpub (2022), 2022TAP0002.}
\stopreferences
\end{frame}
\begin{frame}[fragile]
\frametitle{Defining Homotopies for Channel Codes}
\begin{itemize}
\item Problem: Homotopy continuation algorithms / existing frameworks
only really support square systems, i.e., \# equations = \# variables. The
only really support square systems, i.e., \# equations =
\# variables. The
system $F(\bm{x}) = \bm{0}$ we previously considered is overdefined
\item \textit{Gröbner bases} allow us to ``[...] transform F into
another set G of polynomials [...] such that F and G are equivalent''
another set G of polynomials [...] such that F and G are
equivalent''
\citereference{B01}, i.e., they have the same zeros
\item Limited tests indicate that, for the systems we are interested in,
finding a Gröbner basis yields a square system
@ -352,8 +365,11 @@
\begin{minipage}{0.45\textwidth}
\begin{align*}
\overbrace{\bm{H}}^{\text{Parity chek matrix}} &= \left[ \begin{array}{cc} 1 & 1 \end{array}\right] \\
F(\bm{x}) &= \left[ \begin{array}{c}
\overbrace{\bm{H}}^{\text{Parity check matrix}} &= \left[
\begin{array}{cc} 1 & 1
\end{array}\right] \\
F(\bm{x}) &= \left[
\begin{array}{c}
1 - x_1^2 \\
1 - x_2^2\\
1 - x_1x_2
@ -367,15 +383,17 @@
\end{minipage}%
\begin{minipage}{0.45\textwidth}
\begin{align*}
\tilde{F}(\bm{x}) &= \left[ \begin{array}{c}
\tilde{F}(\bm{x}) &= \left[
\begin{array}{c}
x_1 - x_2 \\
x_2^2 - 1
\end{array}\right] \\
G(\bm{x}) &= \left[\begin{array}{c}
x_1\\
x_2
G(\bm{x}) &= \left[
\begin{array}{c}
x_1 - y_1\\
x_2 - y_2
\end{array}\right]\\
H(\bm{x}, t) &= (t-1)G(\bm{x}) + tF(\bm{x})
H(\bm{x}, t) &= (1-t)G(\bm{x}) + tF(\bm{x})
\end{align*}
\end{minipage} \\
@ -388,7 +406,6 @@
\stopreferences
\end{frame}
\begin{frame}[fragile]
\frametitle{Path Tracker Implementation (Pseudo Code)}
@ -409,17 +426,17 @@
baselinestretch=1, % Line spacing
breaklines, % Allow line breaking
tabsize=4, % Tab width
]{python}
func perform_prediction_step(y) {...}
func perform_correction_step(y, step_size) {...}
]{c}
func perform_prediction_step(y, step_size) {...}
func perform_correction_step(y) {...}
func perform_step(y0) {
for i in range(max_retries):
step_size = step_size / 2
y = perform_prediction_step(y0)
y = perform_prediction_step(y0, step_size)
for k in range(max_corrector_iterations):
y = perform_correction_step(y, step_size)
y = perform_correction_step(y)
if (corrector converged) break
if (corrector converged) break
@ -437,7 +454,6 @@ func perform_step(y0) {
\stopreferences
\end{frame}
\begin{frame}[fragile]
\frametitle{Decoding Algorithm Implementation (Pseudo Code)}
@ -453,7 +469,7 @@ func perform_step(y0) {
baselinestretch=1, % Line spacing
breaklines, % Allow line breaking
tabsize=4, % Tab width
]{python}
]{c}
func decode(y) {
for i in range(max_iterations):
y = perform_step(y)
@ -466,80 +482,118 @@ func decode(y) {
\end{minted}
\end{frame}
\begin{frame}
\begin{frame}[fragile]
\frametitle{Simulation results}
\begin{figure}[H]
\centering
\begin{subfigure}{0.5\textwidth}
\begin{subfigure}[c]{0.48\textwidth}
\centering
\vskip 0pt
\begin{tikzpicture}
\begin{axis}[
domain=-5:5,
width=\textwidth,
height=0.75\textwidth,
ylabel={FER (-\,-\,-), BER (---)},
ymode=log,
legend,
xlabel = {$Eb/N0$ (dB)},
legend pos= south west,
xmax=6
]
\addplot+[mark=none, line width=1pt]
{x^2};
\addplot+[mark=none, line width=1pt]
{x^3};
\addplot+[mark=none, line width=1pt]
{x^4};
% \addplot+[scol0, densely dashed, mark=none, line
% width=1pt, forget plot]
% table[col sep=comma, x=SNR, y=FER]
% {\res/bch_31_26_hc.csv};
% \addplot+[scol0, mark=none, line width=1pt]
% table[col sep=comma, x=SNR, y=BER]
% {\res/bch_31_26_hc.csv};
% \addlegendentry{Homotopy continuation}
%
\addplot+[scol0, densely dashed, mark=none, line width=1pt,
forget plot]
table[col sep=comma, x=SNR, y=FER]
{\res/bch_31_26_hc.csv};
\addplot+[scol0, mark=none, line width=1pt]
table[col sep=comma, x=SNR, y=BER]
{\res/bch_31_26_hc.csv};
\addlegendentry{Homotopy continuation}
\addplot+[scol2, densely dashed, mark=none, line width=1pt,
forget plot]
table[col sep=comma, x=SNR, y=FER, discard if
not={gamma}{0.05}]
{\res/bch_31_26_proximal.csv};
\addplot+[scol2, mark=none, line width=1pt]
table[col sep=comma, x=SNR, y=BER, discard if
not={gamma}{0.05}]
{\res/bch_31_26_proximal.csv};
\addlegendentry{Proximal decoding}
% \addplot+[scol2, densely dashed, mark=none, line
% width=1pt, forget plot]
% table[col sep=comma, x=SNR, y=FER]
% {\res/bch_31_26_ml.csv};
% \addplot+[scol2, mark=none, line width=1pt]
% table[col sep=comma, x=SNR, y=BER]
% {\res/bch_31_26_ml.csv};
\addlegendentry{ML}
% \addplot+[mark=none, line width=1pt]
% table[col sep=comma, x=SNR, y=DFR]
% {\res/bch_31_11.csv};
% \addlegendentry{DFR}
\end{axis}
\end{tikzpicture}
\caption{BCH(31,26) Code}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\begin{subfigure}[c]{0.48\textwidth}
\centering
\begin{tikzpicture}
\begin{axis}[
domain=-5:5,
width=\textwidth,
height=0.75\textwidth,
]
\addplot+[mark=none, line width=1pt]
{x};
\addplot+[mark=none, line width=1pt]
{2*x};
\addplot+[mark=none, line width=1pt]
{3*x};
\end{axis}
\end{tikzpicture}
\vspace*{-20mm}
\begin{tabular}{rl|ccccc}
Parameter & Value \\ \hline
$n_\text{iter}$ & for homotopy continuation & 20 \\
$n_\text{iter}$ & for Newton corrector & 5 \\
$\delta_\text{max}$ & for Newton corrector & 0.01 \\
$\Delta s$ & for Euler predictor & 0.05 \\
$n_\text{retries}$ & for Euler predictor & 5
\end{tabular}
\bigskip
\begin{itemize}
\item Newton homotopy:
\begin{align*}
G(\bm{x}) &= F(x) - F(\bm{y}) \\
H(\bm{x}) &= (1-t)G(\bm{x}) - tF(\bm{x})\\
&= F(\bm{x}) - (1 - t) F(\bm{y})
\end{align*}
\end{itemize}
\end{subfigure}
\end{figure}
% \begin{figure}[H]
% \centering
%
% \begin{tikzpicture}
% \begin{axis}[
% width=\textwidth,
% height=0.75\textwidth,
% ]
% \addplot+[mark=none, line width=1pt]
% table[col sep=comma, x=x, y=y]
% {};
% \end{axis}
% \end{tikzpicture}
% \end{figure}
\end{frame}
\begin{frame}
\frametitle{Next steps}
\begin{itemize}
\item Simulations for other codes
\item Thorough investigation into parameter choice
\item Find more mathematical background / guarantees \begin{itemize}
\item Find more mathematical background / guarantees
\begin{itemize}
\item How do we have to choose $\sigma_0$?
\item Guarantees for convergence? (i.e., what is the cause for
decoding failures?)
\item When do we actually get square systems using the Gröbner basis?
\item When do we actually get square systems using
the Gröbner basis?
\end{itemize}
\item Other ideas: \begin{itemize}
\item Other ideas:
\begin{itemize}
\item Generate more candidates by moving further along the
solution curve (if this is possible) and then performing
choosing from this list
@ -547,6 +601,4 @@ func decode(y) {
\end{itemize}
\end{frame}
\end{document}