\section{Decoding Algorithms}%
\label{sec:Decoding Algorithms}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Proximal Decoding}%
\label{sub:Alg Proximal Decoding}

\begin{frame}[t]
    \frametitle{Proximal Decoding: General Idea}

    \todo{How do I properly cite \cite{proximal_paper} here?}

    \begin{itemize}
        \item Code constraint polynomial:
            \begin{align*}
            h\left( \boldsymbol{x} \right) =
                \underbrace{\sum_{j=1}^{n} \left( x_j^2 - 1 \right)^2}_{\text{Bipolar constraint}}
                + \underbrace{\sum_{i=1}^{m} \left[ \left(
                    \prod_{j\in\mathcal{A}\left( i \right)} x_j\right) -1 \right]^2}
                        _{\text{Parity constraint}},
            \hspace{5mm}\mathcal{A}\left( i \right) \equiv \left\{
                j | j\in \mathcal{J},
                \boldsymbol{H}_{j,i} = 1
            \right\},
            i \in \mathcal{I}
            \end{align*}
        \item Approximation of prior PDF:
            \begin{align*}
                f_{\boldsymbol{X}}\left( \boldsymbol{x} \right)
                    = \frac{1}{\left| \mathcal{C}\left( \boldsymbol{H} \right)  \right| }
                        \sum_{c \in \mathcal{C}\left( \boldsymbol{H} \right) }
                            \delta\left( \boldsymbol{x} - \boldsymbol{c} \right) 
                    \approx \frac{1}{Z} e^{-\gamma h\left( x \right) }
            \end{align*}
        \item MAP rule:
            \begin{align*}
                \hat{\boldsymbol{x}}
                    = arg\max_{x\in\mathbb{R}}\left[
                        f_{\boldsymbol{Y}}\left( \boldsymbol{y} | \boldsymbol{x} \right)
                        f_{\boldsymbol{X}}\left( \boldsymbol{x} \right) \right]
                    = arg\max_{x\in\mathbb{R}}\left[
                        e^{-L\left( \boldsymbol{y} | \boldsymbol{x}\right)}
                        e^{-\gamma h\left( \boldsymbol{x} \right) } \right]
            \end{align*}
    \end{itemize}
\end{frame}

\begin{frame}[t]
    \frametitle{Proximal Decoding: General Idea}

    \begin{itemize}
        \item Objective function:
            \begin{align*}
                f\left( \boldsymbol{x} \right)
                    = L\left( \boldsymbol{y} | \boldsymbol{x} \right)
                    + \gamma h\left( \boldsymbol{x} \right),
                    \hspace{5mm} L\left( \boldsymbol{y} | \boldsymbol{x} \right)
                        = - \ln\left( f_{\boldsymbol{Y}}
                            \left( \boldsymbol{y} | \boldsymbol{x} \right)  \right)
            \end{align*}
            \note{Notational difference between $f$ and $f_X$ or $f_Y$}
        \item Code proximal operator \cite{proximal_algorithms}:
            \begin{align*}
                \text{prox}_{\gamma h} \left( \boldsymbol{x} \right) &\equiv
                    arg\min_{\boldsymbol{z}\in\mathbb{R}} \left(
                        \gamma h\left( \boldsymbol{z} \right) + \frac{1}{2} \lVert \boldsymbol{z}
                            - \boldsymbol{x} \rVert^2  \right)\\
                        &\approx \boldsymbol{x} - \gamma \nabla h\left( \boldsymbol{x} \right),
                        \hspace{5mm} \gamma \text{ small}
            \end{align*}
        \item Iterative decoding process:
            \begin{align*}
                \boldsymbol{r}^{\left( k+1 \right) } &= \boldsymbol{s}^{\left( k \right) }
                    - \omega \nabla L\left( \boldsymbol{y} | \boldsymbol{s}^{\left( k \right) }
                    \right), \hspace{5mm} \omega > 0
                    \hspace{10mm} \text{``Gradient descent step''}\\
                \boldsymbol{s}^{\left( k+1 \right) } &= \boldsymbol{r}^{\left( k+1 \right) }
                    - \gamma \nabla h\left( \boldsymbol{r}^{\left( k+1 \right) } \right)
                    \hspace{22mm} \text{``Code proximal step''}
            \end{align*}
    \end{itemize}
\end{frame}

\begin{frame}[t, fragile]
    \frametitle{Proximal Decoding: Algorithm}
    \begin{itemize}
        \item Resulting terative decoding algorithm \cite{proximal_paper}:
    \end{itemize}
            
    \vspace{2mm}
    \begin{algorithm}[caption={}, label={}]
$\boldsymbol{s}^{\left( 0 \right)} = \boldsymbol{0}$
for $k=0$ to $K-1$ do
    $\boldsymbol{r}^{\left( k+1 \right)} = \boldsymbol{s}^{(k)} - \omega \nabla L \left( \boldsymbol{s}^{(k)}; \boldsymbol{y} \right) $
    Compute $\nabla h\left( \boldsymbol{r}^{\left( k+1 \right) } \right)$
    $\boldsymbol{s}^{\left( k+1 \right)} = \boldsymbol{r}^{(k+1)} - \gamma \nabla h\left( \boldsymbol{r}^{\left( k+1 \right) } \right) $
    $\boldsymbol{\hat{x}} = \text{sign}\left( \boldsymbol{s}^{\left( k+1 \right) } \right) $
    If $\boldsymbol{\hat{x}}$ passes the parity check condition, break the loop.
end for
Output $\boldsymbol{\hat{x}}$
    \end{algorithm}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ADMM}%
\label{sub:Alg ADMM}

\begin{frame}[t]
    \frametitle{ADMM Decoding: General Idea}

    \todo{TODO}
\end{frame}

\begin{frame}[t]
    \frametitle{ADMM Decoding: Algorithm}

    \todo{TODO}
\end{frame}

