%%%------------------------------------------------------------------------------------------------------------ \begin{tcolorbox} [bicolor,sidebyside,width=11cm,righthand width=4cm,size=title,frame engine=empty, colback=blue!10!white,colbacklower=black!5!white] {\scriptsize \begin{tabbing} \texttt{XTensor x, y, h1, h2;} \\ \texttt{XTensor w1, b1, w2, w3;} \\ \texttt{InitTensor3D(\&x, 3, 4, 5);} \\ \texttt{InitTensor2D(\&w1, 5, 3);} \\ \texttt{InitTensor1D(\&b1, 3);} \\ \texttt{InitTensor2D(\&w2, 3, 6);} \\ \texttt{InitTensor2D(\&w3, 6, 4);} \\ \texttt{...} \\ \texttt{h1 = Sigmoid(MMul(x, w1) + b1);} \\ \texttt{h2 = HandTanH(MMul(h1, w2));} \\ \texttt{y = Relu(MMul(h2, w3));} \end{tabbing} } \tcblower \begin{center} \begin{tikzpicture} \node [draw,circle,inner sep=2pt,fill=red!30!white,blur shadow={shadow xshift=1pt,shadow yshift=-1pt}] (x) at (0,0) {\footnotesize{$\textrm{x}$}}; \node [anchor=south,draw,rounded corners,inner sep=2pt,minimum width=4em,fill=green!30!white,blur shadow={shadow xshift=1pt,shadow yshift=-1pt}] (layer1) at ([yshift=0.7em]x.north) {\scriptsize{layer1}}; \node [anchor=south,draw,rounded corners,inner sep=2pt,minimum width=4em,fill=green!30!white,blur shadow={shadow xshift=1pt,shadow yshift=-1pt}] (layer2) at ([yshift=1.0em]layer1.north) {\scriptsize{layer2}}; \node [anchor=south,draw,rounded corners,inner sep=2pt,minimum width=4em,fill=green!30!white,blur shadow={shadow xshift=1pt,shadow yshift=-1pt}] (layer3) at ([yshift=1.0em]layer2.north) {\scriptsize{layer3}}; \node [anchor=south,draw,circle,inner sep=2pt,fill=red!30!white,blur shadow={shadow xshift=1pt,shadow yshift=-1pt}] (y) at ([yshift=0.7em]layer3.north) {\scriptsize{$\textrm{y}$}}; \draw [thick,->] (x.north) -- (layer1.south); \draw [thick,->] (layer1.north) -- (layer2.south); \draw [thick,->] (layer2.north) -- (layer3.south); \draw [thick,->] (layer3.north) -- (y.south); \node [anchor=west,align=left] (xshape) at (x.east) {\tiny{shape: 3*4*5}}; \node [anchor=west,align=left] (yshape) at (y.east) {\tiny{shape: 3*4*4}}; \node [anchor=south west,align=left,inner sep=2pt] (l1shape) at (layer1.north) {\tiny{shape: 3*4*3}}; \node [anchor=south west,align=left,inner sep=2pt] (l2shape) at (layer2.north) {\tiny{shape: 3*4*6}}; \end{tikzpicture} \end{center} \end{tcolorbox} %%%------------------------------------------------------------------------------------------------------------