More changes to two step computation figure.

master
Aaron Huber 2021-07-01 11:32:16 -04:00
parent 334b78c526
commit 42d44a6c4b
2 changed files with 81 additions and 44 deletions

View File

@ -56,25 +56,32 @@
%pdb cylinder
\node[cylinder, text width=0.28\textwidth, align=center, draw=black, text=blue, cylinder uses custom fill, cylinder body fill=blue!10, aspect=0.12, minimum height=5cm, minimum width=2.5cm, cylinder end fill=blue!50, shape border rotate=90] (cylinder) at (0, 0) {
\tabcolsep=0.1cm
\begin{tabular}{>{\footnotesize}c | >{\footnotesize}c >{\footnotesize}c >{\footnotesize}c}
$OnTime$ & City$_\ell$ & $\Phi$ & \textbf{p}\\
\hline
& Buffalo & $L_a$ & 0.9 \\
& Chicago & $L_b$ & 0.5\\
& Bremen & $L_c$ & 0.5\\
& Zurich & $L_d$ & 1.0\\
\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
\begin{tabular}{>{\small}c >{\small}c >{\small}c}
\multicolumn{3}{c}{$\boldsymbol{OnTime}$}\\
\toprule
City$_\ell$ & $\Phi$ & \textbf{p}\\
\midrule
Buffalo & $L_a$ & 0.9 \\
Chicago & $L_b$ & 0.5\\
Bremen & $L_c$ & 0.5\\
Zurich & $L_d$ & 1.0\\
\end{tabular}\\
\tabcolsep=0.05cm
\begin{tabular}{ >{\scriptsize}c | >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c}
$Route$ & $\text{City}_1$ & $\text{City}_2$ & $\Phi$ & \textbf{p} \\
\hline
& Buffalo & Chicago & $R_a$ & 1.0 \\
& Chicago & Zurich & $R_b$ & 1.0 \\
%\captionof{table}{Route}
\begin{tabular}{>{\footnotesize}c >{\footnotesize}c >{\footnotesize}c >{\footnotesize}c}
\multicolumn{4}{c}{$\boldsymbol{Route$}}\\
\toprule
$\text{City}_1$ & $\text{City}_2$ & $\Phi$ & \textbf{p} \\
\midrule
Buffalo & Chicago & $R_a$ & 1.0 \\
Chicago & Zurich & $R_b$ & 1.0 \\
%& $\cdots$ & $\cdots$ & $\cdots$ & $\cdots$ \\
& Chicago & Bremen & $R_c$ & 1.0 \\
Chicago & Bremen & $R_c$ & 1.0 \\
\end{tabular}};
%label below cylinder
\node[below=0.2 cm of cylinder]{$\pdb$};
\node[below=0.2 cm of cylinder]{{\LARGE$ \pdb$}};
%First arrow
\node[single arrow, right=0.25 of cylinder, draw=black, fill=black!65, text=white, minimum height=0.75cm, minimum width=0.25cm](arrow1) {\textbf{Step 1}};
\node[above=of arrow1](arrow1Label) {$\query$};
@ -83,10 +90,14 @@
%Query output (output of step 1)
\node[rectangle, right=0.175 of arrow1, draw=black, text=purple, fill=purple!15, minimum height=4.5cm, minimum width=2cm](rect) {
\tabcolsep=0.075cm
\begin{tabular}{ >{\small}c | >{\small}c >{\small}c >{\centering\arraybackslash\small}m{1.95cm}}
$\query$ & City & $\Phi$ & Circuit\\% & $\expct_{\idb \sim \probDist}[\query(\db)(t)]$ \\ \hline
\hline \\\\[-3.5\medskipamount]
& Buffalo & $L_a R_a$ &\resizebox{!}{10mm}{
%\captionof{table}{Q}
\begin{tabular}{>{\normalsize}c >{\normalsize}c >{\centering\arraybackslash\small}m{1.95cm}}
\multicolumn{3}{c}{$\boldsymbol{\query(\pdb)}$}\\
\toprule
City & $\Phi$ & Circuit\\% & $\expct_{\idb \sim \probDist}[\query(\db)(t)]$ \\ \hline
\midrule
%\hline \\\\[-3.5\medskipamount]
Buffalo & $L_a R_a$ &\resizebox{!}{10mm}{
\begin{tikzpicture}[thick]
\node[gen_tree_node](sink) at (0.5, 0.8){$\boldsymbol{\circmult}$};
\node[gen_tree_node](source1) at (0, 0){$L_a$};
@ -95,43 +106,66 @@
\draw[->] (source2)--(sink);
\end{tikzpicture}% & $0.5 \cdot 1.0 + 0.5 \cdot 1.0 = 1.0$
}\\% & $0.9$ \\
& Chicago & $L_b R_b + L_b R_c$&\resizebox{!}{16mm} {
\begin{tikzpicture}[thick]
\node[gen_tree_node] (a2) at (0, 0){$R_b$};
\node[gen_tree_node] (b2) at (1, 0){$L_b$};
\node[gen_tree_node] (c2) at (2, 0){$R_c$};
%level 1
\node[gen_tree_node] (a1) at (0.5, 0.8){$\boldsymbol{\circmult}$};
\node[gen_tree_node] (b1) at (1.5, 0.8){$\boldsymbol{\circmult}$};
%level 0
\node[gen_tree_node] (a0) at (1.0, 1.6){$\boldsymbol{\circplus}$};
%edges
\draw[->] (a2) -- (a1);
\draw[->] (b2) -- (a1);
\draw[->] (b2) -- (b1);
\draw[->] (c2) -- (b1);
\draw[->] (a1) -- (a0);
\draw[->] (b1) -- (a0);
\end{tikzpicture}
}\\
Chicago & $L_b R_b + L_b R_c$&
\resizebox{!}{16mm} {
\begin{tikzpicture}[thick]
\node[gen_tree_node] (a1) at (1, 0){$R_b$};
\node[gen_tree_node] (b1) at (2, 0){$R_c$};
%level 1
\node[gen_tree_node] (a2) at (0.75, 0.8){$L_b$};
\node[gen_tree_node] (b2) at (1.5, 0.8){$\boldsymbol{\circplus}$};
%level 0
\node[gen_tree_node] (a3) at (1.1, 1.6){$\boldsymbol{\circmult}$};
%edges
\draw[->] (a1) -- (b2);
\draw[->] (b1) -- (b2);
\draw[->] (a2) -- (a3);
\draw[->] (b2) -- (a3);
\end{tikzpicture}
}\\
%%%%%%%%%%%
%Non factorized circuit%
%%%%%%%%%%%
%\resizebox{!}{16mm} {
%\begin{tikzpicture}[thick]
% \node[gen_tree_node] (a2) at (0, 0){$R_b$};
% \node[gen_tree_node] (b2) at (1, 0){$L_b$};
% \node[gen_tree_node] (c2) at (2, 0){$R_c$};
% %level 1
% \node[gen_tree_node] (a1) at (0.5, 0.8){$\boldsymbol{\circmult}$};
% \node[gen_tree_node] (b1) at (1.5, 0.8){$\boldsymbol{\circmult}$};
% %level 0
% \node[gen_tree_node] (a0) at (1.0, 1.6){$\boldsymbol{\circplus}$};
% %edges
% \draw[->] (a2) -- (a1);
% \draw[->] (b2) -- (a1);
% \draw[->] (b2) -- (b1);
% \draw[->] (c2) -- (b1);
% \draw[->] (a1) -- (a0);
% \draw[->] (b1) -- (a0);
% \end{tikzpicture}
% }\\
\end{tabular}
};
%label below rectangle
\node[below=0.2cm of rect]{$\query(\pdb)$};
\node[below=0.2cm of rect]{{\LARGE $\query(\pdb)$}};
%Second arrow
\node[single arrow, right=0.25 of rect, draw=black, fill=black!65, text=white, minimum height=0.75cm, minimum width=0.25cm](arrow2) {\textbf{Step 2}};
%Expectation computation; (output of step 2)
\node[rectangle, right=0.25 of arrow2, rounded corners, draw=black, fill=red!15, text=red, minimum height=4.5cm, minimum width=2cm](rrect) {
\tabcolsep=0.09cm
\begin{tabular}{>{\footnotesize}c | >{\footnotesize}c >{\footnotesize}m{1.95cm}}
$\query$ & City & $\mathbb{E}[\poly(\vct{X})]$\\
\hline
& Buffalo & $1.0 \cdot 0.9 = 0.9$\\
& Chicago & $(0.5 \cdot 1.0) + $\newline $\hspace{0.2cm}(0.5 \cdot 1.0)$\newline $= 1.0$\\
%\captionof{table}{Q}
\begin{tabular}{>{\small}c >{\centering\arraybackslash\small}m{1.95cm}}
\multicolumn{2}{c}{$\expct\pbox{\poly(\vct{X})}$}\\
\toprule
City & $\mathbb{E}[\poly(\vct{X})]$\\
\midrule[0.02em]
Buffalo & $1.0 \cdot 0.9 = 0.9$\\
Chicago & $(0.5 \cdot 1.0) + $\newline $\hspace{0.2cm}(0.5 \cdot 1.0)$\newline $= 1.0$\\
\end{tabular}
};
%label of rounded rectangle
\node[below=0.2cm of rrect]{$\expct\pbox{\poly(\vct{X})}$};
\node[below=0.2cm of rrect]{{\LARGE $\expct\pbox{\poly(\vct{X})}$}};
\end{tikzpicture}
}
\caption{Two step model of computation}

View File

@ -4,6 +4,9 @@
%\usepackage{cellspace}
%\setlength\cellspacetoplimit{50pt}
%\setlength\cellspacebottomlimit{50pt}
\usepackage{caption}%caption for table
\usepackage{booktabs}
\usepackage{bm}%for math mode bold font
\usepackage{algpseudocode}
\usepackage{algorithm}