Pooling edges

Edge pooling operation, also known as edge feature aggregation.

Author

Emre Anakok

Published

March 18, 2025

\documentclass[border=3pt,tikz]{standalone}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{pgfplots}
\definecolor{taupegray}{rgb}{0.55, 0.52, 0.54}
\def\general_height{0.2}

\usepackage{tikz-network}
\begin{document}

\begin{tikzpicture}

    %\Text[x=-0.18,y=3cm]{\Large Couche $N$}
    %\Text[x=14cm,y=3cm]{\Large Couche $N+1$}
    
    \begin{scope}[scale=2]
    \Vertex[x=0.88,y=0.48,label=A,color=white]{A}
    \Vertex[x=-0.18,y=0.98,label=B,color=white]{B}
    \Vertex[x=-1,y=0.12,label=C,color=white]{C}
    \Vertex[x=-0.42,y=-0.9,label=D,color=white]{D}
    \Vertex[x=0.72,y=-0.69,label=E,color=white]{E}
    \Edge[color=pink](A)(B)
    \Edge[color=green](A)(C)
    \Edge[color=red](A)(D)
    \Edge[color=blue](A)(E)
    \Edge[color=yellow](B)(C)
    \Edge[color=orange](B)(D)
    \Edge[color=gray](B)(E)
    \end{scope}
    
    \begin{scope}[xshift=4cm]
    \node[] at (1.5cm,4.5cm) {\huge $X^{E(l)}$};
    \node[align = center, text width=5cm] at (1.5cm,6cm) {\Large Données sur toutes les arêtes};
    
    \Vertex[x=0,y=3,Pseudo]{bar_1}
    \begin{axis}[ybar stacked, 
    yshift = 3cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=yellow,opacity=0.5] coordinates
            {(0,0.15) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
        \end{axis}
    
    \Vertex[x=0,y=2,Pseudo]{bar_2}
    \begin{axis}[ybar stacked, 
    yshift = 2cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=pink,opacity=0.5] coordinates
            {(0,0.1) (1,0.05) (2,0.3) (3,0.2) (4,0.0)};
        \end{axis}
    
    \Vertex[x=0,y=1,Pseudo]{bar_3}
    \begin{axis}[ybar stacked, 
    yshift = 1cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=green,opacity=0.5] coordinates
            {(0,0.2) (1,0.05) (2,0.1) (3,0.15) (4,0.05)};
        \end{axis}
     
    \Vertex[x=0,y=0,Pseudo]{bar_4}
    \begin{axis}[ybar stacked,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=gray,opacity=0.5] coordinates
            {(0,0.1) (1,0.1) (2,0.15) (3,0.2) (4,0.15)};
        \end{axis}
    
    
    
    \Vertex[x=0,y=-1,Pseudo]{bar_5}
    \begin{axis}[ybar stacked, 
    yshift = -1cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=blue,opacity=0.5] coordinates
            {(0,0.2) (1,0.1) (2,0.2) (3,0.15) (4,0.05)};
        \end{axis}
    
    \Vertex[x=0,y=-2,Pseudo]{bar_6}
    \begin{axis}[ybar stacked, 
    yshift = -2cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
        \addplot[fill=red,opacity=0.5] coordinates
            {(0,0.1) (1,0.2) (2,0) (3,0.1) (4,0.1)};
        \end{axis}
    \Vertex[x=0,y=-3,Pseudo]{bar_7}
     
    \begin{axis}[ybar stacked, 
    yshift = -3cm,
    height=\general_height\textwidth,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
    \addplot[fill=orange,opacity=0.5] coordinates
            {(0,0.2) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
    \end{axis}
     
     \Vertex[x=3,y=0,Pseudo]{barplots}
    
    \end{scope}
    \begin{scope}[xshift=12cm]
    \node[] at (1.5cm,4.5cm) {\huge $X^{U(l+1)}$};
    \node[align = center, text width=4cm] at (1.5cm,6cm) {\Large Données de contexte global};
    
    \Vertex[x=0,y=0,Pseudo]{agregation}
    
    
    \begin{axis}[ybar stacked,
    height= 7cm,
    yshift = -2cm,
     bar width=13pt,ymin=0,
     x=17pt,
     ytick=\empty,
     xtick=\empty,
     hide axis]
     \addplot[fill=orange,opacity=0.5] coordinates
            {(0,0.15) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
      \addplot[fill=red,opacity=0.5] coordinates
            {(0,0.1) (1,0.05) (2,0.3) (3,0.2) (4,0.0)};
      \addplot[fill=blue,opacity=0.5] coordinates
            {(0,0.2) (1,0.05) (2,0.1) (3,0.15) (4,0.05)};
     \addplot[fill=gray,opacity=0.5] coordinates
            {(0,0.1) (1,0.1) (2,0.15) (3,0.2) (4,0.15)};
      \addplot[fill=green,opacity=0.5] coordinates
            {(0,0.2) (1,0.1) (2,0.2) (3,0.15) (4,0.05)};
      \addplot[fill=pink,opacity=0.5] coordinates
            {(0,0.1) (1,0.2) (2,0) (3,0.1) (4,0.1)};
      \addplot[fill=yellow,opacity=0.5] coordinates
            {(0,0.2) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
     \end{axis}
     \Vertex[x=3,y=-3.5,Pseudo]{N}  
    \end{scope}
    %\node[align=center,text width=5cm] at (1,-4.5) {\large Agrégation des données des noeuds voisins};
    
    \Edge[bend=35,style={dashed},Direct]($(A)!.5!(B)$)(bar_2)
    \Edge[bend=35,style={dashed},Direct]($(A)!.5!(C)$)(bar_3)
    \Edge[bend=-35,style={dashed},Direct]($(A)!.5!(D)$)(bar_6)
    \Edge[bend=-35,style={dashed},Direct]($(A)!.5!(E)$)(bar_5)
    \Edge[bend=70,style={dashed},Direct]($(B)!.5!(C)$)(bar_1)
    \Edge[bend=-35,style={dashed},Direct]($(B)!.5!(D)$)(bar_7)
    \Edge[bend=10,style={dashed},Direct]($(B)!.5!(E)$)(bar_4)
    
    \Edge[style={dashed},Direct,label={\Huge $\phi$}](barplots)(agregation)
    \end{tikzpicture}
    
    
\end{document}