Moved from specific definitions(Conv,ConvRelu) to Generic(Box,BandedBox). Also refactored and cleaned the code

This commit is contained in:
Haris Iqbal
2018-12-20 20:28:44 +01:00
parent bed2cc7b5f
commit f0e1e511f3
41 changed files with 666 additions and 1779 deletions
Binary file not shown.
+17 -19
View File
@@ -1,10 +1,8 @@
\documentclass[border=15pt, multi, tikz]{standalone}
%\usepackage{blocks}
\usepackage{import}
\subimport{../../layers/}{init}
\usetikzlibrary{positioning}
\newcommand{\midarrow}{\tikz \draw[-Stealth,line width =0.8mm,draw=\edgecolor] (-0.3,0) -- ++(0.3,0);}
\newcommand{\up}{0.25}
\newcommand{\down}{0.25}
\newcommand{\arrowlength}{4}
@@ -12,35 +10,35 @@
\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,pool1
\pic[shift={(0,0,0)},fill={rgb:blue,1.5;red,3.5;green,3.5;white,5}] at (0,0,0) {GenericSequentialLayer={blockname=crp1,%
numFilters={{" ",""}},height=20,width={7},depth=20, blocklabel=SoftmaxLoss: $E_\mathcal{S}$ ,ylabel= ,zlabel= }};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw connections
%% Draw previous 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 (crp1-west)++(0,\up,0) coordinate (crp1-west-up);
\draw [connection] (crp1-west-up)++(-\arrowlength,0,0)
\draw [connection] (-\arrowlength,\up,0)
node[anchor=south west,scale=2.1]{$p(x^{(t)})$}
-- node {\midarrow} (crp1-west-up);
\draw [connection] (crp1-west)++(0,-\down,0) -- node {\midarrow} ++(-\arrowlength.0,0)
-- 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 (crp1-east)++(0,-\down,0) coordinate (crp1-east-down);
\draw [connection] (crp1-east-down)++(\arrowlength,0,0)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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} (crp1-east-down);
-- node {\midarrow} ++(-\arrowlength,0,0);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%