
\documentclass[border=8pt, multi, tikz]{standalone} 
\usepackage{import}
\subimport{../layers/}{init}
\usetikzlibrary{positioning}
\usetikzlibrary{3d} %for including external image 


\def\ConvColor{rgb:yellow,5;red,2.5;white,5}
\def\ConvReluColor{rgb:yellow,5;red,5;white,5}
\def\PoolColor{rgb:red,1;black,0.3}
\def\UnpoolColor{rgb:blue,2;green,1;black,0.3}
\def\FcColor{rgb:blue,5;red,2.5;white,5}
\def\FcReluColor{rgb:blue,5;red,5;white,4}
\def\SoftmaxColor{rgb:magenta,5;black,7}   
\def\SumColor{rgb:blue,5;green,15}


\newcommand{\copymidarrow}{\tikz \draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}

\begin{document}
\begin{tikzpicture}
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]


\pic[shift={(0,0,0)}] at (0,0,0) 
    {Box={
        name=input,
        caption=Input,
        captionshift=0,
        xlabel={{1, }},
        zlabeloffset=0.2,
        zlabel={{2048×32}},
        fill=\ConvColor,
        height=26,
        width=1,
        depth=52
        }
    };


\pic[shift={(2,0,0)}] at (input-east) 
    {Box={
        name=dwconv1,
        caption=,
        captionshift=0,
        xlabel={{1, }},
        zlabeloffset=0.3,
        zlabel=,
        fill=\ConvColor,
        height=26,
        width=1,
        depth=52
        }
    };


\pic[shift={(0,0,0)}] at (dwconv1-east) 
    {Box={
        name=dwconv2,
        caption=Conv1,
        captionshift=0,
        xlabel={{16, }},
        zlabeloffset=0.15,
        zlabel={{2048×32}},
        fill=\ConvColor,
        height=26,
        width=4,
        depth=52
        }
    };


\pic[shift={ (0,0,0) }] at (dwconv2-east) 
    {Box={
        name=pool1,
        xlabel={{, }},
        zlabeloffset=0.3,
        zlabel={{512×32}},
        caption=,
        captionshift=0,
        fill=\PoolColor,
        opacity=0.5,
        height=26,
        width=4,
        depth=24
        }
    };


\pic[shift={(2,0,0)}] at (pool1-east) 
    {Box={
        name=dwconv3,
        caption=,
        captionshift=0,
        xlabel={{1, }},
        zlabeloffset=0.3,
        zlabel=,
        fill=\ConvColor,
        height=26,
        width=1,
        depth=24
        }
    };


\pic[shift={(0,0,0)}] at (dwconv3-east) 
    {Box={
        name=dwconv4,
        caption=Conv2,
        captionshift=0,
        xlabel={{32, }},
        zlabeloffset=0.3,
        zlabel={{512×32}},
        fill=\ConvColor,
        height=26,
        width=8,
        depth=24
        }
    };


\pic[shift={ (0,0,0) }] at (dwconv4-east) 
    {Box={
        name=pool2,
        xlabel={{, }},
        zlabeloffset=0.45,
        zlabel={{256×16}},
        caption=,
        captionshift=0,
        fill=\PoolColor,
        opacity=0.5,
        height=18,
        width=8,
        depth=12
        }
    };


\pic[shift={ (0,0,0) }] at (pool2-east) 
    {Box={
        name=pool3,
        xlabel={{, }},
        zlabeloffset=0.45,
        zlabel={{128×8}},
        caption=,
        captionshift=0,
        fill=\PoolColor,
        opacity=0.5,
        height=12,
        width=8,
        depth=6
        }
    };


\pic[shift={(1,0,0)}] at (pool3-east) 
    {Box={
        name=squeeze,
        caption=Squeeze,
        captionshift=0,
        xlabel={{8, }},
        zlabeloffset=0.45,
        zlabel={{128×8}},
        fill=\ConvColor,
        height=12,
        width=2,
        depth=6
        }
    };


\pic[shift={(2,-.5,0)}] at (squeeze-east)
    {Box={
        name=fc1,
        caption=FC,
        captionshift=0,
        xlabel={{" ","dummy"}},
        zlabeloffset=0.5,
        zlabel={{8×128×8}},
        fill=\FcColor,
        opacity=0.8,
        height=1,
        width=1,
        depth=24
        }
    };


\pic[shift={(1.3,0.5,0)}] at (fc1-east) 
    {Box={
        name=latent,
        caption=Latent Space,
        captionshift=0,
        xlabel={{, }},
        zlabeloffset=0.3,
        zlabel=latent dim,
        fill=\ConvColor,
        height=19.200000000000003,
        width=1,
        depth=1
        }
    };


\end{tikzpicture}
\end{document}

