Convert submodule PlotNeuralNet into a regular folder
This commit is contained in:
216
thesis/third_party/PlotNeuralNet/examples/AlexNet/alexnet.tex
vendored
Normal file
216
thesis/third_party/PlotNeuralNet/examples/AlexNet/alexnet.tex
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
\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,2;green,5;white,5}
|
||||
\def\FcReluColor{blue,2;green,5;;white,4}
|
||||
\def\SoftmaxColor{rgb:magenta,5;black,7}
|
||||
|
||||
|
||||
\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=conv0,
|
||||
caption= ,
|
||||
xlabel={{3, }},
|
||||
zlabel=224,
|
||||
fill=\ConvColor,
|
||||
height=44.8,
|
||||
width=3,
|
||||
depth=44.8
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (conv0-east)
|
||||
{Box={
|
||||
name=conv1,
|
||||
caption= ,
|
||||
xlabel={{96, }},
|
||||
zlabel=55,
|
||||
fill=\ConvColor,
|
||||
height=11.0,
|
||||
width=4.8,
|
||||
depth=11.0
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv0-east) -- node {\midarrow} (conv1-west);
|
||||
|
||||
|
||||
\pic[shift={ (0,0,0) }] at (conv1-east)
|
||||
{Box={
|
||||
name=pool1,
|
||||
caption= ,
|
||||
fill=\PoolColor,
|
||||
opacity=0.5,
|
||||
height=5.4,
|
||||
width=1,
|
||||
depth=5.4
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (pool1-east)
|
||||
{Box={
|
||||
name=conv2,
|
||||
caption= ,
|
||||
xlabel={{256, }},
|
||||
zlabel=27,
|
||||
fill=\ConvColor,
|
||||
height=5.4,
|
||||
width=12.8,
|
||||
depth=5.4
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (pool1-east) -- node {\midarrow} (conv2-west);
|
||||
|
||||
|
||||
\pic[shift={ (0,0,0) }] at (conv2-east)
|
||||
{Box={
|
||||
name=pool2,
|
||||
caption= ,
|
||||
fill=\PoolColor,
|
||||
opacity=0.5,
|
||||
height=2.6,
|
||||
width=1,
|
||||
depth=2.6
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (pool2-east)
|
||||
{Box={
|
||||
name=conv3,
|
||||
caption= ,
|
||||
xlabel={{384, }},
|
||||
zlabel=13,
|
||||
fill=\ConvColor,
|
||||
height=2.6,
|
||||
width=19.2,
|
||||
depth=2.6
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (pool2-east) -- node {\midarrow} (conv3-west);
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (conv3-east)
|
||||
{Box={
|
||||
name=conv4,
|
||||
caption= ,
|
||||
xlabel={{384, }},
|
||||
zlabel=13,
|
||||
fill=\ConvColor,
|
||||
height=2.6,
|
||||
width=19.2,
|
||||
depth=2.6
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv3-east) -- node {\midarrow} (conv4-west);
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (conv4-east)
|
||||
{Box={
|
||||
name=conv5,
|
||||
caption= ,
|
||||
xlabel={{256, }},
|
||||
zlabel=13,
|
||||
fill=\ConvColor,
|
||||
height=2.6,
|
||||
width=12.8,
|
||||
depth=2.6
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv4-east) -- node {\midarrow} (conv5-west);
|
||||
|
||||
|
||||
\pic[shift={ (0,0,0) }] at (conv5-east)
|
||||
{Box={
|
||||
name=pool3,
|
||||
caption= ,
|
||||
fill=\PoolColor,
|
||||
opacity=0.5,
|
||||
height=1.2,
|
||||
width=1,
|
||||
depth=1.2
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (pool3-east)
|
||||
{Box={
|
||||
name=Fc1,
|
||||
caption= ,
|
||||
xlabel={{1, }},
|
||||
zlabel=4096,
|
||||
fill=\FcColor,
|
||||
height=1,
|
||||
width=1,
|
||||
depth=40.96
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (pool3-east) -- node {\midarrow} (Fc1-west);
|
||||
|
||||
|
||||
\pic[shift={(2,0,0)}] at (Fc1-east)
|
||||
{Box={
|
||||
name=Fc2,
|
||||
caption= ,
|
||||
xlabel={{1, }},
|
||||
zlabel=4096,
|
||||
fill=\FcColor,
|
||||
height=1,
|
||||
width=1,
|
||||
depth=40.96
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (Fc1-east) -- node {\midarrow} (Fc2-west);
|
||||
|
||||
|
||||
\pic[shift={(3,0,0)}] at (Fc2-east)
|
||||
{Box={
|
||||
name=soft1,
|
||||
caption=SOFT,
|
||||
xlabel={{" ","dummy"}},
|
||||
zlabel=1000,
|
||||
fill=\SoftmaxColor,
|
||||
opacity=0.8,
|
||||
height=3,
|
||||
width=1.5,
|
||||
depth=25
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (Fc2-east) -- node {\midarrow} (soft1-west);
|
||||
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
BIN
thesis/third_party/PlotNeuralNet/examples/AlexNet/alexnet_data.png
vendored
Normal file
BIN
thesis/third_party/PlotNeuralNet/examples/AlexNet/alexnet_data.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
134
thesis/third_party/PlotNeuralNet/examples/HED/HED.tex
vendored
Normal file
134
thesis/third_party/PlotNeuralNet/examples/HED/HED.tex
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
\documentclass[border=15pt, multi, tikz]{standalone}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\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\DcnvColor{rgb:blue,5;green,2.5;white,5}
|
||||
\def\SoftmaxColor{rgb:magenta,5;black,7}
|
||||
\def\SumColor{rgb:blue,5;green,15}
|
||||
\def\poolsep{1}
|
||||
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.6]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Layer Blocks
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% conv1_1,conv1_2,%pool1
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
|
||||
xlabel={{"64","64"}},zlabel=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
\pic[shift={(\poolsep,0,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.5,height=30,width=1,depth=30}};
|
||||
% conv2_1,conv2_2,pool2
|
||||
\pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
|
||||
xlabel={{"64","64"}},zlabel=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=30,width={3,3},depth=30}};
|
||||
\pic[shift={(\poolsep,0,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.5,height=23,width=1,depth=23}};
|
||||
% conv3_1,conv3_2,pool3
|
||||
\pic[shift={(1,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
|
||||
xlabel={{"256","256","256"}},zlabel=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=23,width={4,4,4},depth=23}};
|
||||
\pic[shift={(\poolsep,0,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.5,height=14,width=1,depth=14}};
|
||||
% conv4_1,conv4_2,conv4_3,pool4
|
||||
\pic[shift={(1,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
|
||||
xlabel={{"512","512","512"}},zlabel=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=14,width={7,7,7},depth=14}};
|
||||
\pic[shift={(\poolsep,0,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.5,height=8,width=1,depth=8}};
|
||||
% conv5_1,conv5_2,conv5_3,pool5
|
||||
\pic[shift={(1,0,0)}] at (p4-east) {RightBandedBox={name=cr5,%
|
||||
xlabel={{"512","512","512"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=8,width={7,7,7},depth=8}};
|
||||
%% fc8 -> cr8 (score32)
|
||||
\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=score16,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,%
|
||||
height=8,width=2,depth=8,zlabel=I/16}};
|
||||
|
||||
%% Upsampling Deconv Layer
|
||||
%% Dcnv16
|
||||
\pic[shift={(2.5,0,0)}] at (score16-east) {Box={name=d16,%
|
||||
xlabel={{"","dummy"}},fill=\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};
|
||||
%% Dcnv8
|
||||
\pic[shift={(.25,0,0)}] at (d16-east) {Box={name=d8,%
|
||||
xlabel={{"","dummy"}},fill=\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};
|
||||
%% Dcnv4
|
||||
\pic[shift={(.25,0,0)}] at (d8-east) {Box={name=d4,%
|
||||
xlabel={{"","dummy"}},fill=\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};
|
||||
%% Dcnv2
|
||||
\pic[shift={(.25,0,0)}] at (d4-east) {Box={name=d2,%
|
||||
xlabel={{"","dummy"}},fill=,opacity=0.01,height=40,width=0.5,depth=40}};
|
||||
|
||||
%% Dcnv envelope
|
||||
\pic[shift={(-0.2,0,0)}] at (d16-west) {Box={name=env,caption=concatenation of deconvolved feature maps,%
|
||||
xlabel={{"","dummy"}},fill=,opacity=0.2,height=42,width={8},depth=42}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\def\skipshift{6.5}
|
||||
%%Joining with previous streams (fcn-16)
|
||||
%% score16
|
||||
\pic[shift={(0,0,3+\skipshift)}] at (cr5-anchor) {Box={name=score8,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,height=14,width=2,depth=14,zlabel=I/8}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%Joining with previous streams (fcn-8)
|
||||
%% score8
|
||||
\pic[shift={(0,0,8+\skipshift)}] at (cr4-east) {Box={name=score4,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,height=23,width=2,depth=23,zlabel=I/4}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%Joining with previous streams (fcn-4)
|
||||
%% score4
|
||||
\pic[shift={(1,0,13+\skipshift)}] at (cr3-east) {Box={name=score2,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,height=30,width=2,depth=30,zlabel=I/2}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%Joining with previous streams (fcn-2)
|
||||
%% score2
|
||||
\pic[shift={(0.3,0,22+\skipshift)}] at (p2-east) {Box={name=score,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,height=40,width=2,depth=40,zlabel=I}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Final convolution
|
||||
|
||||
\pic[shift={(3,0,0)}] at (d2-east) {Box={name=output,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,height=40,width=2,depth=40,zlabel=I}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%% Draw connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (cr1-east) -- node {\midarrow} (p1-west);
|
||||
\draw [connection] (p1-east) -- node {\midarrow} (cr2-west);
|
||||
\draw [connection] (cr2-east) -- node {\midarrow} (p2-west);
|
||||
\draw [connection] (p2-east) -- node {\midarrow} (cr3-west);
|
||||
\draw [connection] (cr3-east) -- node {\midarrow} (p3-west);
|
||||
\draw [connection] (p3-east) -- node {\midarrow} (cr4-west);
|
||||
\draw [connection] (cr4-east) -- node {\midarrow} (p4-west);
|
||||
\draw [connection] (p4-east) -- node {\midarrow} (cr5-west);
|
||||
\draw [connection] (score16-east) -- node {\midarrow} (d16-west);
|
||||
%
|
||||
\path (cr4-east) -- (p4-west) coordinate[pos=0.4] (after4) ;
|
||||
\draw (d16-near)++(0,0,-1+\skipshift) coordinate (d16h);
|
||||
\draw [connection] (after4) -- node {\midarrow} ++(0,0,3+\skipshift) -- node {\midarrow} (score8-west);
|
||||
\draw [connection] (score8-east) -- node{\midarrow} (d16h) -- node{\midarrow}(d16-near);
|
||||
%
|
||||
\path (cr3-east) -- (p3-west) coordinate[pos=0.4] (after3) ;
|
||||
\draw (d8-near)++(0,0,4+\skipshift) coordinate (d8h);
|
||||
\draw [connection] (after3) -- node {\midarrow} ++(0,0,8+\skipshift) -- node {\midarrow} (score4-west);
|
||||
\draw [connection] (score4-east) -- node{\midarrow} (d8h) -- node{\midarrow}(d8-near);
|
||||
%
|
||||
\path (cr2-east) -- (p2-west) coordinate[pos=0.4] (after2) ;
|
||||
\draw (d4-near)++(0,0,9+\skipshift) coordinate (d4h);
|
||||
\draw [connection] (after2) -- node {\midarrow} ++(0,0,13+\skipshift) -- node {\midarrow} (score2-west);
|
||||
\draw [connection] (score2-east) -- node{\midarrow} (d4h) -- node{\midarrow}(d4-near);
|
||||
%
|
||||
\path (cr1-east) -- (p1-west) coordinate[pos=0.4] (after1) ;
|
||||
\draw (d2-near)++(0,0,18+\skipshift) coordinate (d2h);
|
||||
\draw [connection] (after1) -- node {\midarrow} ++(0,0,22+\skipshift) -- node {\midarrow} (score-west);
|
||||
\draw [connection] (score-east) -- node{\midarrow} (d2h) -- node{\midarrow}(d2-near);
|
||||
|
||||
\draw [connection] (d2-east) -- node {\midarrow} (output-west);
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}\grid
|
||||
152
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet.tex
vendored
Normal file
152
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet.tex
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
\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}
|
||||
|
||||
|
||||
\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=conv0,
|
||||
caption= ,
|
||||
xlabel={{1, }},
|
||||
zlabel=32,
|
||||
fill=\ConvColor,
|
||||
height=32,
|
||||
width=1,
|
||||
depth=32
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (conv0-east)
|
||||
{Box={
|
||||
name=conv1,
|
||||
caption= ,
|
||||
xlabel={{6, }},
|
||||
zlabel=28,
|
||||
fill=\ConvColor,
|
||||
height=28,
|
||||
width=6,
|
||||
depth=28
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv0-east) -- node {\midarrow} (conv1-west);
|
||||
|
||||
|
||||
\pic[shift={ (0,0,0) }] at (conv1-east)
|
||||
{Box={
|
||||
name=pool1,
|
||||
caption= ,
|
||||
fill=\PoolColor,
|
||||
opacity=0.5,
|
||||
height=14,
|
||||
width=6,
|
||||
depth=14
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (pool1-east)
|
||||
{Box={
|
||||
name=conv2,
|
||||
caption= ,
|
||||
xlabel={{16, }},
|
||||
zlabel=10,
|
||||
fill=\ConvColor,
|
||||
height=10,
|
||||
width=16,
|
||||
depth=10
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (pool1-east) -- node {\midarrow} (conv2-west);
|
||||
|
||||
|
||||
\pic[shift={ (0,0,0) }] at (conv2-east)
|
||||
{Box={
|
||||
name=pool2,
|
||||
caption= ,
|
||||
fill=\PoolColor,
|
||||
opacity=0.5,
|
||||
height=5,
|
||||
width=16,
|
||||
depth=5
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\pic[shift={(1,0,0)}] at (pool2-east)
|
||||
{Box={
|
||||
name=conv3,
|
||||
caption= ,
|
||||
xlabel={{1, }},
|
||||
zlabel=120,
|
||||
fill=\ConvColor,
|
||||
height=1,
|
||||
width=1,
|
||||
depth=120
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (pool2-east) -- node {\midarrow} (conv3-west);
|
||||
|
||||
|
||||
\pic[shift={(2,0,0)}] at (conv3-east)
|
||||
{Box={
|
||||
name=conv4,
|
||||
caption= ,
|
||||
xlabel={{1, }},
|
||||
zlabel=84,
|
||||
fill=\ConvColor,
|
||||
height=1,
|
||||
width=1,
|
||||
depth=84
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv3-east) -- node {\midarrow} (conv4-west);
|
||||
|
||||
|
||||
\pic[shift={(3,0,0)}] at (conv4-east)
|
||||
{Box={
|
||||
name=soft1,
|
||||
caption=SOFT,
|
||||
xlabel={{" ","dummy"}},
|
||||
zlabel=10,
|
||||
fill=\SoftmaxColor,
|
||||
opacity=0.8,
|
||||
height=3,
|
||||
width=1.5,
|
||||
depth=25
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
\draw [connection] (conv4-east) -- node {\midarrow} (soft1-west);
|
||||
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
8
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet.txt
vendored
Normal file
8
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
input(32, 32, 1)
|
||||
conv(28, 28, 6)
|
||||
pool(14, 14, 6)
|
||||
conv(10, 10, 16)
|
||||
pool(5, 5, 16)
|
||||
conv(1,1,120)
|
||||
fullyconn(1,1,84)
|
||||
softmax(1,1,10)
|
||||
BIN
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet_data2.png
vendored
Normal file
BIN
thesis/third_party/PlotNeuralNet/examples/LeNet/lenet_data2.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
47
thesis/third_party/PlotNeuralNet/examples/SoftmaxLoss/SoftmaxLoss.tex
vendored
Normal file
47
thesis/third_party/PlotNeuralNet/examples/SoftmaxLoss/SoftmaxLoss.tex
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
\documentclass[border=15pt, multi, tikz]{standalone}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\newcommand{\up}{0.25}
|
||||
\newcommand{\down}{0.25}
|
||||
\newcommand{\arrowlength}{4}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw previous connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (-\arrowlength,\up,0)
|
||||
node[anchor=south west,scale=2.1]{$p(x^{(t)})$}
|
||||
-- node {\midarrow} (0,\up,0);
|
||||
\draw [connection] (0,-\down,0) -- node {\midarrow} ++(-\arrowlength.0,0)
|
||||
node[anchor=north west,inner sep = 10, xshift=-25,scale=2.3]
|
||||
{
|
||||
$\frac{\partial L}{\partial E_\mathcal{S}}\frac{\partial E_\mathcal{S}}{\partial p}$
|
||||
};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Layer Blocks
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {Box={name=crp1,caption=SoftmaxLoss: $E_\mathcal{S}$ ,%
|
||||
fill={rgb:blue,1.5;red,3.5;green,3.5;white,5},opacity=0.5,height=20,width=7,depth=20}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw next connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (crp1-east)++(0,\up,0) -- node {\midarrow} ++(\arrowlength.0,0)
|
||||
node [anchor=south east,scale=2.1]{$E_\mathcal{S} [p;\theta]$};
|
||||
|
||||
\draw [connection] (crp1-east)++(\arrowlength,-\down,0)
|
||||
node[anchor=north east,inner sep = 10, xshift=25,scale=2.3]
|
||||
{
|
||||
$\frac{\partial L}{\partial E_\mathcal{S}} = \lambda_\mathcal{S}$
|
||||
}
|
||||
-- node {\midarrow} ++(-\arrowlength,0,0);
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
164
thesis/third_party/PlotNeuralNet/examples/Unet/Unet.tex
vendored
Normal file
164
thesis/third_party/PlotNeuralNet/examples/Unet/Unet.tex
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
\documentclass[border=8pt, multi, tikz]{standalone}
|
||||
%\usepackage{blocks}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\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}
|
||||
|
||||
|
||||
\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]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Encoder
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% conv1_1,conv1_2
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
|
||||
xlabel={{"64","64"}},zlabel=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
%pool1
|
||||
\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.5,height=32,width=1,depth=32}};
|
||||
%%%%%%%%%%
|
||||
% conv2_1,conv2_2
|
||||
\pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
|
||||
xlabel={{"128","128"}},zlabel=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width={3.5,3.5},depth=32}};
|
||||
%pool2
|
||||
\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.5,height=25,width=1,depth=25}};
|
||||
%%%%%%%%%%
|
||||
% conv3_1,conv3_2
|
||||
\pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
|
||||
xlabel={{"256","256"}},zlabel=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width={4.5,4.5},depth=25}};
|
||||
%pool3
|
||||
\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.5,height=16,width=1,depth=16}};
|
||||
%%%%%%%%%%
|
||||
% conv4_1,conv4_2,conv4_3
|
||||
\pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
|
||||
xlabel={{"512","512"}},zlabel=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width={6,6},depth=16}};
|
||||
%pool4
|
||||
\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.5,height=8,width=1,depth=8}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Bottleneck
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
|
||||
\pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%
|
||||
xlabel={{"1024","1024"}},zlabel=I/16,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=8,width={8,8},depth=8}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Decoder
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% unpool4,
|
||||
\pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
|
||||
\pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
|
||||
xlabel={{"512","dummy"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width=6,depth=16}};
|
||||
\pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%
|
||||
xlabel={{"512",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};
|
||||
\pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
|
||||
xlabel={{"512","512"}},zlabel=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width={6,6},depth=16}};
|
||||
%%%%%%%%%%
|
||||
%% unpool3,
|
||||
\pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
|
||||
\pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
|
||||
xlabel={{"256","dummy"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width=4.5,depth=25}};
|
||||
\pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%
|
||||
xlabel={{"256",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};
|
||||
\pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
|
||||
xlabel={{"256","256"}},zlabel=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width={4.5,4.5},depth=25}};
|
||||
%%%%%%%%%%
|
||||
%% unpool2,
|
||||
\pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
|
||||
\pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
|
||||
xlabel={{"128","dummy"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width=3.5,depth=32}};
|
||||
\pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%
|
||||
xlabel={{"128",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};
|
||||
\pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
|
||||
xlabel={{"128","128"}},zlabel=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width={3.5,3.5},depth=32}};
|
||||
%%%%%%%%%%
|
||||
%% unpool1,
|
||||
\pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
|
||||
\pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
|
||||
xlabel={{"64","dummy"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width=2.5,depth=40}};
|
||||
\pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%
|
||||
xlabel={{"64",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};
|
||||
\pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
|
||||
xlabel={{"64","64"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2.5,2.5},depth=40}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Classifier
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
|
||||
zlabel=I,fill=\SoftmaxColor,height=40,width=1,depth=40}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Draw connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (p1-east) -- node {\midarrow} (cr2-west);
|
||||
\draw [connection] (p2-east) -- node {\midarrow} (cr3-west);
|
||||
\draw [connection] (p3-east) -- node {\midarrow} (cr4-west);
|
||||
\draw [connection] (p4-east) -- node {\midarrow} (cr5-west);
|
||||
\draw [connection] (cr5-east) -- node {\midarrow} (up4-west);
|
||||
\draw [connection] (ucr4a-east) -- node {\midarrow} (up3-west);
|
||||
\draw [connection] (ucr3a-east) -- node {\midarrow} (up2-west);
|
||||
\draw [connection] (ucr2a-east) -- node {\midarrow} (up1-west);
|
||||
\draw [connection] (ucr1a-east) -- node {\midarrow} (out-west);
|
||||
%\draw [connection] (out-east) -- node {\midarrow} ++(2,0,0);
|
||||
|
||||
\path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;
|
||||
\path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;
|
||||
\path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;
|
||||
\path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;
|
||||
|
||||
\path (cat4-south) -- (cat4-north) coordinate[pos=1.25] (cat4-top) ;
|
||||
\path (cat3-south) -- (cat3-north) coordinate[pos=1.25] (cat3-top) ;
|
||||
\path (cat2-south) -- (cat2-north) coordinate[pos=1.25] (cat2-top) ;
|
||||
\path (cat1-south) -- (cat1-north) coordinate[pos=1.25] (cat1-top) ;
|
||||
%
|
||||
\draw [copyconnection] (cr4-northeast)
|
||||
-- node {\copymidarrow}(cr4-top)
|
||||
-- node {\copymidarrow}(cat4-top)
|
||||
-- node {\copymidarrow} (cat4-north);
|
||||
%
|
||||
\draw [copyconnection] (cr3-northeast)
|
||||
-- node {\copymidarrow}(cr3-top)
|
||||
-- node {\copymidarrow}(cat3-top)
|
||||
-- node {\copymidarrow} (cat3-north);
|
||||
%
|
||||
\draw [copyconnection] (cr2-northeast)
|
||||
-- node {\copymidarrow}(cr2-top)
|
||||
-- node {\copymidarrow}(cat2-top)
|
||||
-- node {\copymidarrow} (cat2-north);
|
||||
%
|
||||
\draw [copyconnection] (cr1-northeast)
|
||||
-- node {\copymidarrow}(cr1-top)
|
||||
-- node {\copymidarrow}(cat1-top)
|
||||
-- node {\copymidarrow} (cat1-north);
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
151
thesis/third_party/PlotNeuralNet/examples/Unet_Ushape/Unet_ushape.tex
vendored
Normal file
151
thesis/third_party/PlotNeuralNet/examples/Unet_Ushape/Unet_ushape.tex
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
\documentclass[border=8pt, multi, tikz]{standalone}
|
||||
%\usepackage{blocks}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\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\ConcatColor{rgb:blue,5;red,2.5;white,5}
|
||||
\def\FcReluColor{rgb:blue,5;red,5;white,4}
|
||||
\def\SoftmaxColor{rgb:magenta,5;black,7}
|
||||
|
||||
|
||||
\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]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Encoder
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% conv1_1,conv1_2
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
|
||||
xlabel={{"64","64"}},caption=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
%pool1
|
||||
\pic[shift={(1.2,-10,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.6,height=32,width=1,depth=32}};
|
||||
%%%%%%%%%%
|
||||
% conv2_1,conv2_2
|
||||
\pic[shift={(0,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
|
||||
xlabel={{"128","128"}},caption=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width={3.5,3.5},depth=32}};
|
||||
%pool2
|
||||
\pic[shift={(1.2,-8.5,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.6,height=25,width=1,depth=25}};
|
||||
%%%%%%%%%%
|
||||
% conv3_1,conv3_2
|
||||
\pic[shift={(0,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
|
||||
xlabel={{"256","256"}},caption=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width={4.5,4.5},depth=25}};
|
||||
%pool3
|
||||
\pic[shift={(1.2,-6.5,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.6,height=16,width=1,depth=16}};
|
||||
%%%%%%%%%%
|
||||
% conv4_1,conv4_2,conv4_3
|
||||
\pic[shift={(0,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
|
||||
xlabel={{"512","512"}},caption=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width={6,6},depth=16}};
|
||||
%pool4
|
||||
\pic[shift={(1.2,-3,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.6,height=8,width=1,depth=8}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Bottleneck
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
|
||||
\pic[shift={(0,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=I/16,%
|
||||
xlabel={{"1024","1024"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=8,width={8,8},depth=8}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Decoder
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% unpool4,
|
||||
\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=up4,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
|
||||
\pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
|
||||
xlabel={{"512","dummy"}},caption=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width=6,depth=16}};
|
||||
\pic[shift={(0,3,0)}] at (ucr4-anchor) {Ball={name=cat4,fill=\ConcatColor,radius=2.5,logo=$||$}};
|
||||
\pic[shift={(1.4,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
|
||||
xlabel={{"512","512"}},caption=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=16,width={6,6},depth=16}};
|
||||
%%%%%%%%%%
|
||||
%% unpool3,
|
||||
\pic[shift={(0,0,0)}] at (ucr4a-east) {Box={name=up3,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
|
||||
\pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
|
||||
xlabel={{"256","dummy"}},caption=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width=4.5,depth=25}};
|
||||
\pic[shift={(0,6.5,0)}] at (ucr3-anchor) {Ball={name=cat3,fill=\ConcatColor,radius=2.5,logo=$||$}};
|
||||
\pic[shift={(1.5,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
|
||||
xlabel={{"256","256"}},caption=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=25,width={4.5,4.5},depth=25}};
|
||||
%%%%%%%%%%
|
||||
%% unpool2,
|
||||
\pic[shift={(0,0,0)}] at (ucr3a-east) {Box={name=up2,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
|
||||
\pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
|
||||
xlabel={{"128","dummy"}},caption=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width=3.5,depth=32}};
|
||||
\pic[shift={(0,8.5,0)}] at (ucr2-anchor) {Ball={name=cat2,fill=\ConcatColor,radius=2.5,logo=$||$}};
|
||||
\pic[shift={(1.8,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
|
||||
xlabel={{"128","128"}},caption=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=32,width={3.5,3.5},depth=32}};
|
||||
%%%%%%%%%%
|
||||
%% unpool1,
|
||||
\pic[shift={(0,0,0)}] at (ucr2a-east) {Box={name=up1,%
|
||||
fill=\UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
|
||||
\pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
|
||||
xlabel={{"64","dummy"}},caption=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width=2.5,depth=40}};
|
||||
\pic[shift={(0,10,0)}] at (ucr1-anchor) {Ball={name=cat1,fill=\ConcatColor,radius=2.5,logo=$||$}};
|
||||
\pic[shift={(2,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
|
||||
xlabel={{"64","64"}},caption=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2.5,2.5},depth=40}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Classifier
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\pic[shift={(2,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
|
||||
zlabel=I,fill=\SoftmaxColor,height=40,width=1,depth=40}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Draw connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\path (cr1-east) -- (p1-west|-cr1-west) coordinate[pos=0.5] (crp1-mid) ;
|
||||
\path (cr2-east) -- (p2-west|-cr2-west) coordinate[pos=0.5] (crp2-mid) ;
|
||||
\path (cr3-east) -- (p3-west|-cr3-west) coordinate[pos=0.5] (crp3-mid) ;
|
||||
\path (cr4-east) -- (p4-west|-cr4-west) coordinate[pos=0.5] (crp4-mid) ;
|
||||
|
||||
\draw[connection](cr1-east)--node{\midarrow}(crp1-mid)--node{\midarrow}(p1-west-|crp1-mid)--node{\midarrow}(p1-west);
|
||||
\draw[connection](cr2-east)--node{\midarrow}(crp2-mid)--node{\midarrow}(p2-west-|crp2-mid)--node{\midarrow}(p2-west);
|
||||
\draw[connection](cr3-east)--node{\midarrow}(crp3-mid)--node{\midarrow}(p3-west-|crp3-mid)--node{\midarrow}(p3-west);
|
||||
\draw[connection](cr4-east)--node{\midarrow}(crp4-mid)--node{\midarrow}(p4-west-|crp4-mid)--node{\midarrow}(p4-west);
|
||||
|
||||
%\draw [connection] (cr5-east) -- node {\midarrow} (up4-west);
|
||||
%\draw [connection] (ucr4a-east) -- node {\midarrow} (up3-west);
|
||||
%\draw [connection] (ucr3a-east) -- node {\midarrow} (up2-west);
|
||||
%\draw [connection] (ucr2a-east) -- node {\midarrow} (up1-west);
|
||||
\draw [connection] (ucr1a-east) -- node {\midarrow} (out-west);
|
||||
%\draw [connection] (out-east) -- node {\midarrow} ++(2,0,0);
|
||||
|
||||
\draw [copyconnection] (cr4-east) -- node {\copymidarrow} (cat4-west);
|
||||
\draw [copyconnection] (cr3-east) -- node {\copymidarrow} (cat3-west);
|
||||
\draw [copyconnection] (cr2-east) -- node {\copymidarrow} (cat2-west);
|
||||
\draw [copyconnection] (cr1-east) -- node {\copymidarrow} (cat1-west);
|
||||
|
||||
\draw [copyconnection] (cat4-east) -- node {\copymidarrow} (ucr4a-west);
|
||||
\draw [copyconnection] (cat3-east) -- node {\copymidarrow} (ucr3a-west);
|
||||
\draw [copyconnection] (cat2-east) -- node {\copymidarrow} (ucr2a-west);
|
||||
\draw [copyconnection] (cat1-east) -- node {\copymidarrow} (ucr1a-west);
|
||||
|
||||
\draw [copyconnection] (ucr4-north) -- node {\copymidarrow} (cat4-south);
|
||||
\draw [copyconnection] (ucr3-north) -- node {\copymidarrow} (cat3-south);
|
||||
\draw [copyconnection] (ucr2-north) -- node {\copymidarrow} (cat2-south);
|
||||
\draw [copyconnection] (ucr1-north) -- node {\copymidarrow} (cat1-south);
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
105
thesis/third_party/PlotNeuralNet/examples/VGG16/vgg16.tex
vendored
Normal file
105
thesis/third_party/PlotNeuralNet/examples/VGG16/vgg16.tex
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
\documentclass[border=15pt, multi, tikz]{standalone}
|
||||
%\usepackage{blocks}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\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\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}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Layer Blocks
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% conv1_1,conv1_2
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%
|
||||
xlabel={{"64","64"}},ylabel=224,zlabel=224,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
%pool1
|
||||
\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.5,height=35,width=1,depth=35}};
|
||||
%%%%%%%%%%
|
||||
% conv2_1,conv2_2
|
||||
\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%
|
||||
xlabel={{"128","128"}},zlabel=112,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=35,width={3,3},depth=35}};
|
||||
%pool2
|
||||
\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.5,height=30,width=1,depth=30}};
|
||||
%%%%%%%%%%
|
||||
% conv3_1,conv3_2
|
||||
\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%
|
||||
xlabel={{"256","256","256"}},zlabel=56,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=30,width={4,4,4},depth=30}};
|
||||
%pool3
|
||||
\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.5,height=23,width=1,depth=23}};
|
||||
%%%%%%%%%%
|
||||
% conv4_1,conv4_2,conv4_3
|
||||
\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%
|
||||
xlabel={{"512","512","512"}},zlabel=28,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=23,width={7,7,7},depth=23}};
|
||||
%pool4
|
||||
\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.5,height=15,width=1,depth=15}};
|
||||
%%%%%%%%%%
|
||||
% conv5_1,conv5_2,conv5_3
|
||||
\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%
|
||||
xlabel={{"512","512","512"}},zlabel=14,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=15,width={7,7,7},depth=15}};
|
||||
%pool5
|
||||
\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%
|
||||
fill=\PoolColor,opacity=0.5,height=10,width=1,depth=10}};
|
||||
%%%%%%%%%%
|
||||
% fc6
|
||||
\pic[shift={(3,0,0)}] at (p5-east) {RightBandedBox={name=fc6,caption=fc6,%
|
||||
xlabel={{"1",""}},zlabel=4096,fill=\FcColor,bandfill=\FcReluColor,%
|
||||
height=3,width=3,depth=100}};
|
||||
%%%%%%%%%%
|
||||
% fc7
|
||||
\pic[shift={(2,0,0)}] at (fc6-east) {RightBandedBox={name=fc7,caption=fc7,%
|
||||
xlabel={{"1","dummy"}},zlabel=4096,fill=\FcColor,bandfill=\FcReluColor,%
|
||||
height=3,width=3,depth=100}};
|
||||
%%%%%%%%%%
|
||||
% fc8
|
||||
\pic[shift={(1.5,0,0)}] at (fc7-east) {RightBandedBox={name=fc8,caption=fc8+softmax,%
|
||||
xlabel={{"1","dummy"}},fill=\FcColor,bandfill=\FcReluColor,%
|
||||
height=3,width=3,depth=25}};
|
||||
|
||||
%%%%%%%%%%
|
||||
% softmax
|
||||
\pic[shift={(0,0,0)}] at (fc8-east) {Box={name=softmax,%
|
||||
xlabel={{"","dummy"}},zlabel=K,opacity=0.8,fill=\SoftmaxColor,%
|
||||
height=3,width=1.5,depth=25}};
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Arrow Connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (p1-east) -- node {\midarrow} (cr2-west);
|
||||
\draw [connection] (p2-east) -- node {\midarrow} (cr3-west);
|
||||
\draw [connection] (p3-east) -- node {\midarrow} (cr4-west);
|
||||
\draw [connection] (p4-east) -- node {\midarrow} (cr5-west);
|
||||
\draw [connection] (p5-east) -- node {\midarrow} (fc6-west);
|
||||
\draw [connection] (fc6-east) -- node {\midarrow} (fc7-west);
|
||||
\draw [connection] (fc7-east) -- node {\midarrow} (fc8-west);
|
||||
\draw [connection] (softmax-east) -- node {\midarrow} ++(1.5,0,0);
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Dotted Edges
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw[densely dashed]
|
||||
(fc6-west)++(0, 1.5*.2, 1.5*.2) coordinate(a) -- (p5-nearnortheast)
|
||||
(fc6-west)++(0,-1.5*.2, 1.5*.2) coordinate(b) -- (p5-nearsoutheast)
|
||||
(fc6-west)++(0,-1.5*.2,-1.5*.2) coordinate(c) -- (p5-farsoutheast)
|
||||
(fc6-west)++(0, 1.5*.2,-1.5*.2) coordinate(d) -- (p5-farnortheast)
|
||||
|
||||
(a)--(b)--(c)--(d)
|
||||
;
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
101
thesis/third_party/PlotNeuralNet/examples/fcn32s/fcn32.tex
vendored
Normal file
101
thesis/third_party/PlotNeuralNet/examples/fcn32s/fcn32.tex
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
\documentclass[border=15pt, multi, tikz]{standalone}
|
||||
\usepackage{import}
|
||||
\subimport{../../layers/}{init}
|
||||
\usetikzlibrary{positioning}
|
||||
|
||||
\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\DcnvColor{rgb:blue,5;green,2.5;white,5}
|
||||
\def\SoftmaxColor{rgb:magenta,5;black,7}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{tikzpicture}
|
||||
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Layer Blocks
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% conv1_1,conv1_2
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%
|
||||
xlabel={{"64","64"}},zlabel=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
%pool1
|
||||
\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.5,height=35,width=1,depth=35}};
|
||||
%%%%%%%%%%
|
||||
% conv2_1,conv2_2
|
||||
\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%
|
||||
xlabel={{"64","64"}},zlabel=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=35,width={3,3},depth=35}};
|
||||
%pool2
|
||||
\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.5,height=30,width=1,depth=30}};
|
||||
%%%%%%%%%%
|
||||
% conv3_1,conv3_2
|
||||
\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%
|
||||
xlabel={{"256","256","256"}},zlabel=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=30,width={4,4,4},depth=30}};
|
||||
%pool3
|
||||
\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.5,height=23,width=1,depth=23}};
|
||||
%%%%%%%%%%
|
||||
% conv4_1,conv4_2,conv4_3
|
||||
\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%
|
||||
xlabel={{"512","512","512"}},zlabel=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=23,width={7,7,7},depth=23}};
|
||||
%pool4
|
||||
\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.5,height=15,width=1,depth=15}};
|
||||
%%%%%%%%%%
|
||||
% conv5_1,conv5_2,conv5_3
|
||||
\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%
|
||||
xlabel={{"512","512","512"}},zlabel=I/16,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=15,width={7,7,7},depth=15}};
|
||||
%pool5
|
||||
\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%
|
||||
fill=\PoolColor,opacity=0.5,height=10,width=1,depth=10}};
|
||||
%%%%%%%%%%
|
||||
%% fc6, fc7 -> cr6, cr7
|
||||
\pic[shift={(1,0,0)}] at (p5-east) {RightBandedBox={name=cr6_7,caption=fc to conv,%
|
||||
xlabel={{"4096","4096"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=10,width={10,10},depth=10}};
|
||||
%%%%%%%%%%
|
||||
%% fc8 -> cr8
|
||||
|
||||
\pic[shift={(1,0,0)}] at (cr6_7-east) {Box={name=c8,caption=fc8 to conv,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,%
|
||||
height=10,width=2,depth=10,zlabel=I/32}};
|
||||
%%%%%%%%%%
|
||||
%% Dcnv32
|
||||
\pic[shift={(2.5,0,0)}] at (c8-east) {Box={name=d32,caption=Deconv,%
|
||||
xlabel={{"K","dummy"}},fill=\DcnvColor,%
|
||||
height=40,width=2,depth=40}};
|
||||
%%%%%%%%%%
|
||||
%% softmax
|
||||
\pic[shift={(1,0,0)}] at (d32-east) {Box={name=softmax,caption=softmax,%
|
||||
xlabel={{"K","dummy"}},fill=\SoftmaxColor,%
|
||||
height=40,width=2,depth=40,zlabel=I}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (p1-east) -- node {\midarrow} (cr2-west);
|
||||
\draw [connection] (p2-east) -- node {\midarrow} (cr3-west);
|
||||
\draw [connection] (p3-east) -- node {\midarrow} (cr4-west);
|
||||
\draw [connection] (p4-east) -- node {\midarrow} (cr5-west);
|
||||
\draw [connection] (p5-east) -- node {\midarrow} (cr6_7-west);
|
||||
\draw [connection] (cr6_7-east) -- node {\midarrow} (c8-west);
|
||||
\draw [connection] (c8-east) -- node {\midarrow} (d32-west);
|
||||
\draw [connection] (d32-east) -- node {\midarrow} (softmax-west);
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Dotted Edges
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw[densely dashed]
|
||||
(c8-nearnortheast) -- (d32-nearnorthwest)
|
||||
(c8-nearsoutheast) -- (d32-nearsouthwest)
|
||||
(c8-farsoutheast) -- (d32-farsouthwest)
|
||||
(c8-farnortheast) -- (d32-farnorthwest)
|
||||
;
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\end{tikzpicture}
|
||||
\end{document}\grid
|
||||
BIN
thesis/third_party/PlotNeuralNet/examples/fcn8s/cats.jpg
vendored
Normal file
BIN
thesis/third_party/PlotNeuralNet/examples/fcn8s/cats.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
127
thesis/third_party/PlotNeuralNet/examples/fcn8s/fcn8.tex
vendored
Normal file
127
thesis/third_party/PlotNeuralNet/examples/fcn8s/fcn8.tex
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
\documentclass[border=15pt, 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\DcnvColor{rgb:blue,5;green,2.5;white,5}
|
||||
\def\SoftmaxColor{rgb:magenta,5;black,7}
|
||||
\def\SumColor{rgb:blue,5;green,15}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw Layer Blocks
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\node[canvas is zy plane at x=0] (temp) at (-3,0,0) {\includegraphics[width=8cm,height=8cm]{cats.jpg}};
|
||||
% conv1_1,conv1_2,%pool1
|
||||
\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%
|
||||
xlabel={{"64","64"}},zlabel=I,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=40,width={2,2},depth=40}};
|
||||
\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
|
||||
fill=\PoolColor,opacity=0.5,height=35,width=1,depth=35}};
|
||||
% conv2_1,conv2_2,pool2
|
||||
\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%
|
||||
xlabel={{"64","64"}},zlabel=I/2,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=35,width={3,3},depth=35}};
|
||||
\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
|
||||
fill=\PoolColor,opacity=0.5,height=30,width=1,depth=30}};
|
||||
% conv3_1,conv3_2,pool3
|
||||
\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%
|
||||
xlabel={{"256","256","256"}},zlabel=I/4,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=30,width={4,4,4},depth=30}};
|
||||
\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
|
||||
fill=\PoolColor,opacity=0.5,height=23,width=1,depth=23}};
|
||||
% conv4_1,conv4_2,conv4_3,pool4
|
||||
\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%
|
||||
xlabel={{"512","512","512"}},zlabel=I/8,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=23,width={7,7,7},depth=23}};
|
||||
\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
|
||||
fill=\PoolColor,opacity=0.5,height=15,width=1,depth=15}};
|
||||
% conv5_1,conv5_2,conv5_3,pool5
|
||||
\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%
|
||||
xlabel={{"512","512","512"}},zlabel=I/16,fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=15,width={7,7,7},depth=15}};
|
||||
\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%
|
||||
fill=\PoolColor,opacity=0.5,height=10,width=1,depth=10}};
|
||||
%% fc6, fc7 -> cr6, cr7
|
||||
\pic[shift={(1,0,0)}] at (p5-east) {RightBandedBox={name=cr6_7,caption=fc to conv,%
|
||||
xlabel={{"4096","4096"}},fill=\ConvColor,bandfill=\ConvReluColor,%
|
||||
height=10,width={10,10},depth=10}};
|
||||
%% fc8 -> cr8 (score32)
|
||||
\pic[shift={(1,0,0)}] at (cr6_7-east) {Box={name=score32,caption=fc8 to conv,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,%
|
||||
height=10,width=2,depth=10,zlabel=I/32}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%Joining with previous streams (fcn-16s)
|
||||
%% Upsampling Deconv Layer
|
||||
%% Dcnv32
|
||||
\pic[shift={(1.5,0,0)}] at (score32-east) {Box={name=d32,%
|
||||
xlabel={{"K","dummy"}},fill=\DcnvColor,%
|
||||
height=15,width=2,depth=15,zlabel=I/16}};
|
||||
%% score16
|
||||
\pic[shift={(0,-4,0)}] at (d32-west) {Box={name=score16,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,%
|
||||
height=15,width=2,depth=15,zlabel=I/16}};
|
||||
%% Elementwise sum between score16 and up32
|
||||
\pic[shift={(1.5,0,0)}] at (d32-east) {Ball={name=elt1,%
|
||||
fill=\SumColor,opacity=0.6,%
|
||||
radius=2.5,logo=$+$}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%Joining with previous streams (fcn-8s)
|
||||
%% Upsampling Deconv Layer
|
||||
%% Dcnv16
|
||||
\pic[shift={(1.5,0,0)}] at (elt1-east) {Box={name=d16,%
|
||||
xlabel={{"K","dummy"}},fill=\DcnvColor,%
|
||||
height=23,width=2,depth=23,zlabel=I/8}};
|
||||
%% score8
|
||||
\pic[shift={(0,-6,0)}] at (d16-west) {Box={name=score8,%
|
||||
xlabel={{"K","dummy"}},fill=\ConvColor,%
|
||||
height=23,width=2,depth=23,zlabel=I/8}};
|
||||
%% Elementwise sum between score16 and up32
|
||||
\pic[shift={(1.5,0,0)}] at (d16-east) {Ball={name=elt2,%
|
||||
fill=\SumColor,opacity=0.6,%
|
||||
radius=2.5,logo=$+$}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%% Output
|
||||
%%%%%%%%%%
|
||||
%% Dcnv8
|
||||
\pic[shift={(2.5,0,0)}] at (elt2-east) {Box={name=d8,%
|
||||
xlabel={{"K","dummy"}},fill=\DcnvColor,%
|
||||
height=40,width=2,depth=40}};
|
||||
%%%%%%%%%%
|
||||
%% softmax
|
||||
\pic[shift={(1,0,0)}] at (d8-east) {Box={name=softmax,caption=softmax,%
|
||||
xlabel={{"K","dummy"}},fill=\SoftmaxColor,%
|
||||
height=40,width=2,depth=40,zlabel=I}};
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Draw connections
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\draw [connection] (p1-east) -- node {\midarrow} (cr2-west);
|
||||
\draw [connection] (p2-east) -- node {\midarrow} (cr3-west);
|
||||
\draw [connection] (p3-east) -- node {\midarrow} (cr4-west);
|
||||
\draw [connection] (p4-east) -- node {\midarrow} (cr5-west);
|
||||
\draw [connection] (p5-east) -- node {\midarrow} (cr6_7-west);
|
||||
\draw [connection] (cr6_7-east) -- node {\midarrow} (score32-west);
|
||||
\draw [connection] (score32-east) -- node {\midarrow} (d32-west);
|
||||
|
||||
\path (p4-east) -- (cr5-west) coordinate[pos=0.25] (between4_5) ;
|
||||
\draw [connection] (between4_5) -- node {\midarrow} (score16-west-|between4_5) -- node {\midarrow} (score16-west);
|
||||
\draw [connection] (d32-east) -- node {\midarrow} (elt1-west);
|
||||
\draw [connection] (score16-east) -- node {\midarrow} (score16-east -| elt1-south) -- node {\midarrow} (elt1-south);
|
||||
\draw [connection] (elt1-east) -- node {\midarrow} (d16-west);
|
||||
|
||||
\path (p3-east) -- (cr4-west) coordinate[pos=0.25] (between3_4) ;
|
||||
\draw [connection] (between3_4) -- node {\midarrow} (score8-west-|between3_4) -- node {\midarrow} (score8-west);
|
||||
\draw [connection] (d16-east) -- node {\midarrow} (elt2-west);
|
||||
\draw [connection] (score8-east) -- node {\midarrow} (score8-east -| elt2-south)-- node {\midarrow} (elt2-south);
|
||||
\draw [connection] (elt2-east) -- node {\midarrow} (d8-west);
|
||||
\draw [connection] (d8-east) -- node{\midarrow} (softmax-west);
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}\grid
|
||||
Reference in New Issue
Block a user