Include pre-built figures when \overleaftrue is set

This commit is contained in:
Andreas Tsouchlos 2024-01-08 14:00:54 +01:00
parent 3805d927bf
commit 2cab8aa178

View File

@ -27,7 +27,11 @@
\newif\ifoverleaf \newif\ifoverleaf
%\overleaftrue %\overleaftrue % When enabled, this option allows the document to be compiled
% on overleaf:
% - common.tex is sourced from a different directory
% - Externalization is disabled
% - Figures are included from pre-build PDFs
% %
@ -362,38 +366,43 @@ decoded bits.%
\begin{figure} \begin{figure}
\centering \centering
\begin{tikzpicture}
\begin{axis}[ \ifoverleaf
grid=both, \includegraphics{figs/letter-figure0.pdf}
xlabel={$E_\text{b} / N_0$ (dB)}, ylabel={}, \else
ymode=log, \begin{tikzpicture}
xmin=1, xmax=8, \begin{axis}[
ymax=1, ymin=1e-6, grid=both,
% ytick={1e-0, 1e-2, 1e-4, 1e-6}, xlabel={$E_\text{b} / N_0$ (dB)}, ylabel={},
width=\figwidth, ymode=log,
height=\figheight, xmin=1, xmax=8,
legend pos = south west, ymax=1, ymin=1e-6,
] % ytick={1e-0, 1e-2, 1e-4, 1e-6},
\addplot+[FERPlot, mark=o, mark options={solid}, scol1] width=\figwidth,
table [x=SNR, y=FER, col sep=comma, height=\figheight,
discard if not={gamma}{0.05}, legend pos = south west,
discard if gt={SNR}{9}] ]
{res/proximal_ber_fer_dfr_20433484.csv}; \addplot+[FERPlot, mark=o, mark options={solid}, scol1]
\addlegendentry{FER} table [x=SNR, y=FER, col sep=comma,
\addplot+[BERPlot, mark=*, scol1] discard if not={gamma}{0.05},
table [x=SNR, y=BER, col sep=comma, discard if gt={SNR}{9}]
discard if not={gamma}{0.05}, {res/proximal_ber_fer_dfr_20433484.csv};
discard if gt={SNR}{7.5}] \addlegendentry{FER}
{res/proximal_ber_fer_dfr_20433484.csv}; \addplot+[BERPlot, mark=*, scol1]
\addlegendentry{BER} table [x=SNR, y=BER, col sep=comma,
\addplot+[DFRPlot, mark=square*, scol0] discard if not={gamma}{0.05},
table [x=SNR, y=DFR, col sep=comma, discard if gt={SNR}{7.5}]
discard if not={gamma}{0.05}, {res/proximal_ber_fer_dfr_20433484.csv};
discard if gt={SNR}{9}] \addlegendentry{BER}
{res/proximal_ber_fer_dfr_20433484.csv}; \addplot+[DFRPlot, mark=square*, scol0]
\addlegendentry{DFR} table [x=SNR, y=DFR, col sep=comma,
\end{axis} discard if not={gamma}{0.05},
\end{tikzpicture} discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{DFR}
\end{axis}
\end{tikzpicture}
\fi
\caption{FER, DFR, and BER for $\left( 3, 6 \right)$-regular LDPC code with \caption{FER, DFR, and BER for $\left( 3, 6 \right)$-regular LDPC code with
$n=204, k=102$ \cite[\text{204.33.484}]{mackay}. $n=204, k=102$ \cite[\text{204.33.484}]{mackay}.
@ -427,93 +436,100 @@ optimization process.%
\begin{figure} \begin{figure}
\centering \centering
\begin{tikzpicture} \ifoverleaf
\begin{axis}[xmin = -1.25, xmax=1.25, \includegraphics{figs/letter-figure1.pdf}
ymin = -1.25, ymax=1.25, \else
xlabel={$\tilde{x}_1$}, \begin{tikzpicture}
ylabel={$\tilde{x}_2$}, \begin{axis}[xmin = -1.25, xmax=1.25,
y label style={at={(axis description cs:-0.06,0.5)},anchor=south}, ymin = -1.25, ymax=1.25,
width=\figwidth, xlabel={$\tilde{x}_1$},
height=\figheight, ylabel={$\tilde{x}_2$},
grid=major, grid style={dotted}, y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
view={0}{90}] width=\figwidth,
\addplot3[point meta=\thisrow{grad_norm}, height=\figheight,
point meta min=1, grid=major, grid style={dotted},
point meta max=2.5, view={0}{90}]
quiver={u=\thisrow{grad_0}, \addplot3[point meta=\thisrow{grad_norm},
v=\thisrow{grad_1}, point meta min=1,
scale arrows=.05, point meta max=2.5,
every arrow/.append style={% quiver={u=\thisrow{grad_0},
line width=.3 v=\thisrow{grad_1},
+\pgfplotspointmetatransformed/1000, scale arrows=.05,
-{Latex[length=0pt 5,width=0pt 3]} every arrow/.append style={%
}, line width=.3
}, +\pgfplotspointmetatransformed/1000,
quiver/colored = {mapped color}, -{Latex[length=0pt 5,width=0pt 3]}
-stealth, },
] },
table[col sep=comma] {res/2d_grad_L.csv}; quiver/colored = {mapped color},
\end{axis} -stealth,
\begin{axis}[hide axis, ]
width=\figwidth, table[col sep=comma] {res/2d_grad_L.csv};
height=\figheight, \end{axis}
xmin=10, xmax=50, \begin{axis}[hide axis,
ymin=0, ymax=0.4, width=\figwidth,
legend style={draw=white!15!black, height=\figheight,
legend cell align=left, xmin=10, xmax=50,
empty legend, ymin=0, ymax=0.4,
at={(0.9775,0.97)},anchor=north east}] legend style={draw=white!15!black,
\addlegendimage{mark=none} legend cell align=left,
\addlegendentry{ empty legend,
$\nabla L\left(\boldsymbol{y} at={(0.9775,0.97)},anchor=north east}]
\mid \tilde{\boldsymbol{x}}\right)$ \addlegendimage{mark=none}
}; \addlegendentry{
\end{axis} $\nabla L\left(\boldsymbol{y}
\end{tikzpicture} \mid \tilde{\boldsymbol{x}}\right)$
};
\end{axis}
\end{tikzpicture}
\fi
\vspace{3mm} \vspace{3mm}
\begin{tikzpicture} \ifoverleaf
\begin{axis}[xmin = -1.25, xmax=1.25, \includegraphics{figs/letter-figure2.pdf}
ymin = -1.25, ymax=1.25, \else
width=\figwidth, \begin{tikzpicture}
height=\figheight, \begin{axis}[xmin = -1.25, xmax=1.25,
xlabel={$\tilde{x}_1$}, ymin = -1.25, ymax=1.25,
ylabel={$\tilde{x}_2$}, width=\figwidth,
y label style={at={(axis description cs:-0.06,0.5)},anchor=south}, height=\figheight,
grid=major, grid style={dotted}, xlabel={$\tilde{x}_1$},
view={0}{90}] ylabel={$\tilde{x}_2$},
\addplot3[point meta=\thisrow{grad_norm}, y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
point meta min=1, grid=major, grid style={dotted},
point meta max=7, view={0}{90}]
quiver={u=\thisrow{grad_0}, \addplot3[point meta=\thisrow{grad_norm},
v=\thisrow{grad_1}, point meta min=1,
scale arrows=.03, point meta max=7,
every arrow/.append style={% quiver={u=\thisrow{grad_0},
line width=.5 v=\thisrow{grad_1},
+\pgfplotspointmetatransformed/1000, scale arrows=.03,
-{Latex[length=0pt 5,width=0pt 3]} every arrow/.append style={%
}, line width=.5
}, +\pgfplotspointmetatransformed/1000,
quiver/colored = {mapped color}, -{Latex[length=0pt 5,width=0pt 3]}
-stealth, },
] },
table[col sep=comma] {res/2d_grad_h.csv}; quiver/colored = {mapped color},
\end{axis} -stealth,
\begin{axis}[hide axis, ]
width=\figwidth, table[col sep=comma] {res/2d_grad_h.csv};
height=\figheight, \end{axis}
xmin=10, xmax=50, \begin{axis}[hide axis,
ymin=0, ymax=0.4, width=\figwidth,
legend style={draw=white!15!black, height=\figheight,
legend cell align=left, xmin=10, xmax=50,
empty legend, ymin=0, ymax=0.4,
at={(0.9775,0.97)},anchor=north east}] legend style={draw=white!15!black,
\addlegendimage{mark=none} legend cell align=left,
\addlegendentry{$\nabla h\left(\tilde{\boldsymbol{x}}\right)$}; empty legend,
\end{axis} at={(0.9775,0.97)},anchor=north east}]
\end{tikzpicture} \addlegendimage{mark=none}
\addlegendentry{$\nabla h\left(\tilde{\boldsymbol{x}}\right)$};
\end{axis}
\end{tikzpicture}
\fi
\caption{Gradients \caption{Gradients
$\nabla L\left(\boldsymbol{y} \mid \tilde{\boldsymbol{x}}\right)$ $\nabla L\left(\boldsymbol{y} \mid \tilde{\boldsymbol{x}}\right)$
and $\nabla h \left( \tilde{\boldsymbol{x}} \right)$ for a repetition and $\nabla h \left( \tilde{\boldsymbol{x}} \right)$ for a repetition
@ -537,36 +553,40 @@ oscillate after a certain number of iterations.%
\begin{figure} \begin{figure}
\centering \centering
\begin{tikzpicture} \ifoverleaf
\begin{axis}[ \includegraphics{figs/letter-figure3.pdf}
grid=both, \else
xlabel={Iterations}, \begin{tikzpicture}
width=\figwidth, \begin{axis}[
height=\figheight, grid=both,
xtick={0, 100, ..., 400}, xlabel={Iterations},
xticklabels={0, 50, ..., 200}, width=\figwidth,
xmin=0, xmax=300, height=\figheight,
ymin=-4, ymax=2, xtick={0, 100, ..., 400},
ytick={-4,-3,...,2}, xticklabels={0, 50, ..., 200},
legend pos = south east, xmin=0, xmax=300,
] ymin=-4, ymax=2,
\addplot+ [mark=none, line width=1] ytick={-4,-3,...,2},
table [col sep=comma, x=k, y=comb_r_s_0, legend pos = south east,
discard if gt={k}{300}] ]
{res/extreme_components_20433484_combined.csv}; \addplot+ [mark=none, line width=1]
\addplot+ [mark=none, line width=1, table [col sep=comma, x=k, y=comb_r_s_0,
discard if gt={k}{300}] discard if gt={k}{300}]
table [col sep=comma, x=k, y=grad_L_0] {res/extreme_components_20433484_combined.csv};
{res/extreme_components_20433484_combined.csv}; \addplot+ [mark=none, line width=1,
\addplot+ [mark=none, line width=1] discard if gt={k}{300}]
table [col sep=comma, x=k, y=grad_h_0, table [col sep=comma, x=k, y=grad_L_0]
discard if gt={k}{300}] {res/extreme_components_20433484_combined.csv};
{res/extreme_components_20433484_combined.csv}; \addplot+ [mark=none, line width=1]
\addlegendentry{$\left(\tilde{\boldsymbol{x}}\right)_1$} table [col sep=comma, x=k, y=grad_h_0,
\addlegendentry{$\left(\nabla L\right)_1$} discard if gt={k}{300}]
\addlegendentry{$\left(\nabla h\right)_1$} {res/extreme_components_20433484_combined.csv};
\end{axis} \addlegendentry{$\left(\tilde{\boldsymbol{x}}\right)_1$}
\end{tikzpicture} \addlegendentry{$\left(\nabla L\right)_1$}
\addlegendentry{$\left(\nabla h\right)_1$}
\end{axis}
\end{tikzpicture}
\fi
\caption{Visualization of component $\left(\tilde{\boldsymbol{x}}\right)_1$ \caption{Visualization of component $\left(\tilde{\boldsymbol{x}}\right)_1$
for a decoding operation for a (3,6) regular LDPC code with for a decoding operation for a (3,6) regular LDPC code with
@ -595,21 +615,25 @@ the probability that a given component was decoded incorrectly.%
\begin{figure}[H] \begin{figure}[H]
\centering \centering
\begin{tikzpicture} \ifoverleaf
\begin{axis}[ \includegraphics{figs/letter-figure4.pdf}
grid=both, \else
ylabel=$P(\hat{c}_{i'} \ne c_{i'})$, \begin{tikzpicture}
xlabel=$i'$, \begin{axis}[
ymode=log, grid=both,
ymin=1e-9,ymax=1e-5, ylabel=$P(\hat{c}_{i'} \ne c_{i'})$,
xmin=0,xmax=200, xlabel=$i'$,
width=0.95\figwidth, ymode=log,
height=\figheight, ymin=1e-9,ymax=1e-5,
] xmin=0,xmax=200,
\addplot+ [scol0, mark=none, line width=1] width=0.95\figwidth,
table [col sep=comma, y=p_error]{res/p_error.csv}; height=\figheight,
\end{axis} ]
\end{tikzpicture} \addplot+ [scol0, mark=none, line width=1]
table [col sep=comma, y=p_error]{res/p_error.csv};
\end{axis}
\end{tikzpicture}
\fi
\caption{Probability that a component of the estimated codeword \caption{Probability that a component of the estimated codeword
$\hat{\boldsymbol{c}}\in \mathbb{F}_2^n$ is erroneous for a (3,6) regular $\hat{\boldsymbol{c}}\in \mathbb{F}_2^n$ is erroneous for a (3,6) regular
@ -683,50 +707,54 @@ Again, these parameters were chosen,%
\begin{figure} \begin{figure}
\centering \centering
\begin{tikzpicture} \ifoverleaf
\begin{axis}[ \includegraphics{figs/letter-figure5.pdf}
grid=both, \else
xlabel={$E_\text{b} / N_0$ (dB)}, \begin{tikzpicture}
ymode=log, \begin{axis}[
xmin=1, xmax=8, grid=both,
ymax=1, ymin=1e-6, xlabel={$E_\text{b} / N_0$ (dB)},
width=\figwidth, ymode=log,
height=\figheight, xmin=1, xmax=8,
legend columns=2, ymax=1, ymin=1e-6,
legend style={draw=white!15!black, width=\figwidth,
legend cell align=left, height=\figheight,
at={(0.5,-0.44)},anchor=south} legend columns=2,
] legend style={draw=white!15!black,
legend cell align=left,
at={(0.5,-0.44)},anchor=south}
]
\addplot+[FERPlot, mark=o, mark options={solid}, scol1] \addplot+[FERPlot, mark=o, mark options={solid}, scol1]
table [x=SNR, y=FER, col sep=comma, table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05}, discard if not={gamma}{0.05},
discard if gt={SNR}{9}] discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv}; {res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, prox. dec.}; \addlegendentry{FER, prox. dec.};
\addplot+[BERPlot, mark=*, scol1] \addplot+[BERPlot, mark=*, scol1]
table [x=SNR, y=BER, col sep=comma, table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05}, discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}] discard if gt={SNR}{7.5}]
{res/proximal_ber_fer_dfr_20433484.csv}; {res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, prox. dec.}; \addlegendentry{BER, prox. dec.};
\addplot+[FERPlot, mark=triangle, mark options={solid}, scol2] \addplot+[FERPlot, mark=triangle, mark options={solid}, scol2]
table [x=SNR, y=FER, col sep=comma, table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05}, discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}] discard if gt={SNR}{7.5}]
{res/improved_ber_fer_dfr_20433484.csv}; {res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, improved}; \addlegendentry{FER, improved};
\addplot+[BERPlot, mark=triangle*, scol2] \addplot+[BERPlot, mark=triangle*, scol2]
table [x=SNR, y=BER, col sep=comma, table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05}, discard if not={gamma}{0.05},
discard if gt={SNR}{6.5}] discard if gt={SNR}{6.5}]
{res/improved_ber_fer_dfr_20433484.csv}; {res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, improved}; \addlegendentry{BER, improved};
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\fi
\caption{FER and BER of proximal decoding \cite{proximal_paper} and the \caption{FER and BER of proximal decoding \cite{proximal_paper} and the
improved algorithm for a $\left( 3, 6 \right)$-regular LDPC code with improved algorithm for a $\left( 3, 6 \right)$-regular LDPC code with