Update compilation and actions
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
\newlength{\layerheight}
|
||||
\newlength{\perspective}
|
||||
\newlength{\filters}
|
||||
%\newlength{\unit}
|
||||
%\newlength{\myunit}
|
||||
|
||||
\setlength{\layer}{3cm}
|
||||
\setlength{\layerheight}{3cm}
|
||||
\setlength{\perspective}{1cm}
|
||||
\setlength{\filters}{0.01cm}
|
||||
\setlength{\unit}{0.225cm}
|
||||
\setlength{\myunit}{0.225cm}
|
||||
|
||||
\begin{tikzpicture}
|
||||
|
||||
@@ -50,13 +50,13 @@
|
||||
|
||||
% flatten layer
|
||||
\foreach \x in {2,...,7} {
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer + 3cm, 0.5cm * \x) circle (\unit);
|
||||
\draw (4 * \layer + 3cm + \unit, 0.5cm * \x) -- (5 * \layer + 2cm - \unit, 2.5cm);
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer + 3cm, 0.5cm * \x) circle (\myunit);
|
||||
\draw (4 * \layer + 3cm + \myunit, 0.5cm * \x) -- (5 * \layer + 2cm - \myunit, 2.5cm);
|
||||
};
|
||||
\node[anchor=north, scale=0.5, below=15pt, align=center] at (4 * \layer + 3cm, 1cm) {flatten};
|
||||
|
||||
% output layer
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer + 2cm, 2.5cm - \unit) -- (5 * \layer + 2cm, 2.5cm) circle (\unit) -- (5 * \layer + 2cm, 2.5cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer + 2cm, 2.5cm - \myunit) -- (5 * \layer + 2cm, 2.5cm) circle (\myunit) -- (5 * \layer + 2cm, 2.5cm + \myunit);
|
||||
\draw (5 * \layer + 2cm + 0.05cm, 2.5cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {output layer [1 unit]} -- (5 * \layer + 2cm + 0.10cm, 2.5cm) -- (5 * \layer + 2cm + 0.15cm, 2.5cm + 0.05cm);
|
||||
|
||||
% draw first convolution
|
||||
@@ -81,16 +81,16 @@
|
||||
\filldraw[fill=red!50, draw=black, fill opacity=0.5] (3 * \layer + 40 * \filters + 0.4 * \perspective, 0.6 * \layerheight + 0.4 * \perspective) -- (4 * \layer, 0.3 * \layerheight) -- (3 * \layer + 40 * \filters, 0.6 * \layerheight) -- cycle;
|
||||
|
||||
% draw the "flatenisation"
|
||||
\draw[dashed] (4 * \layer + 20 * \filters, \layerheight) -- (4 * \layer + 3 cm, 3.5cm + \unit) -- (4 * \layer + 20 * \filters + \perspective, \layerheight + \perspective) -- cycle;
|
||||
\draw[dashed] (4 * \layer + 20 * \filters, 0cm) -- (4 * \layer + 3 cm, 1cm - \unit) -- (4 * \layer + 20 * \filters + \perspective, \perspective) -- cycle;
|
||||
\draw[dashed] (4 * \layer + 20 * \filters, \layerheight) -- (4 * \layer + 3 cm, 3.5cm + \myunit) -- (4 * \layer + 20 * \filters + \perspective, \layerheight + \perspective) -- cycle;
|
||||
\draw[dashed] (4 * \layer + 20 * \filters, 0cm) -- (4 * \layer + 3 cm, 1cm - \myunit) -- (4 * \layer + 20 * \filters + \perspective, \perspective) -- cycle;
|
||||
|
||||
% hidden layer labels
|
||||
\node[anchor=base, align=center, text width=3.9cm, scale=0.75] (c) at (11cm, 5.5cm) {convolutional layers ($5 \times 5$ kernel, ReLU activation)};
|
||||
\draw[->] (c) -- (\layer + 180 * \filters + \perspective, \layerheight + \perspective + \unit);
|
||||
\draw[->] (c) -- (2 * \layer + 100 * \filters + \perspective, \layerheight + \perspective + \unit);
|
||||
\draw[->] (c) -- (3 * \layer + 40 * \filters + \perspective, \layerheight + \perspective + \unit);
|
||||
\draw[->] (c) -- (4 * \layer + 0.5 * \perspective, \layerheight + \perspective + \unit);
|
||||
\draw[->] (c) -- (\layer + 180 * \filters + \perspective, \layerheight + \perspective + \myunit);
|
||||
\draw[->] (c) -- (2 * \layer + 100 * \filters + \perspective, \layerheight + \perspective + \myunit);
|
||||
\draw[->] (c) -- (3 * \layer + 40 * \filters + \perspective, \layerheight + \perspective + \myunit);
|
||||
\draw[->] (c) -- (4 * \layer + 0.5 * \perspective, \layerheight + \perspective + \myunit);
|
||||
|
||||
\end{tikzpicture}
|
||||
|
||||
% vim: ft=texft=texft=texft=texft=texx
|
||||
% vim: ft=texft=texft=texft=texft=texx
|
||||
|
||||
100
tikz/fc.pgf
100
tikz/fc.pgf
@@ -1,160 +1,160 @@
|
||||
\newlength{\unit}
|
||||
\newlength{\myunit}
|
||||
\newlength{\layer}
|
||||
|
||||
\setlength{\unit}{0.225cm}
|
||||
\setlength{\myunit}{0.225cm}
|
||||
\setlength{\layer}{1cm}
|
||||
|
||||
\begin{tikzpicture}
|
||||
|
||||
% draw the first layer
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, -0.75cm - \unit) -- (\layer, -0.75cm) circle (\unit) -- (\layer, -0.75cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, -0.75cm - \myunit) -- (\layer, -0.75cm) circle (\myunit) -- (\layer, -0.75cm + \myunit);
|
||||
\draw (\layer + 0.05cm, -0.75cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {FC layer [876 units]} -- (\layer + 0.10cm, -0.75cm) -- (\layer + 0.15cm, -0.75cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (\layer, -0.75cm + 1.25 * \unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (\layer, -0.75cm + 1.25 * \myunit) {$\vdots$};
|
||||
|
||||
\foreach \x in {0,...,5} {
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, 0.5cm * \x - \unit) -- (\layer, 0.5cm * \x) circle (\unit) -- (\layer, 0.5cm * \x + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, 0.5cm * \x - \myunit) -- (\layer, 0.5cm * \x) circle (\myunit) -- (\layer, 0.5cm * \x + \myunit);
|
||||
\draw (\layer + 0.05cm, 0.5cm * \x) -- (\layer + 0.10cm, 0.5cm * \x) -- (\layer + 0.15cm, 0.5cm * \x + 0.05cm);
|
||||
};
|
||||
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, 3.25cm - \unit) -- (\layer, 3.25cm) circle (\unit) -- (\layer, 3.25cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (\layer, 3.25cm - \myunit) -- (\layer, 3.25cm) circle (\myunit) -- (\layer, 3.25cm + \myunit);
|
||||
\draw (\layer + 0.05cm, 3.25cm) -- (\layer + 0.10cm, 3.25cm) -- (\layer + 0.15cm, 3.25cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (\layer, 3.25cm - 2\unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (\layer, 3.25cm - 2\myunit) {$\vdots$};
|
||||
|
||||
% draw the second layer
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, -\unit) -- (2 * \layer, 0cm) circle (\unit) -- (2 * \layer, \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, -\myunit) -- (2 * \layer, 0cm) circle (\myunit) -- (2 * \layer, \myunit);
|
||||
\draw (2 * \layer + 0.05cm, 0cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {FC layer [461 units]} -- (2 * \layer + 0.10cm, 0cm) -- (2 * \layer + 0.15cm, 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (2 * \layer, 1.25 * \unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (2 * \layer, 1.25 * \myunit) {$\vdots$};
|
||||
|
||||
\foreach \x in {1.5,...,3.5} {
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, 0.5cm * \x - \unit) -- (2 * \layer, 0.5cm * \x) circle (\unit) -- (2 * \layer, 0.5cm * \x + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, 0.5cm * \x - \myunit) -- (2 * \layer, 0.5cm * \x) circle (\myunit) -- (2 * \layer, 0.5cm * \x + \myunit);
|
||||
\draw (2 * \layer + 0.05cm, 0.5cm * \x) -- (2 * \layer + 0.10cm, 0.5cm * \x) -- (2 * \layer + 0.15cm, 0.5cm * \x + 0.05cm);
|
||||
};
|
||||
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, 2.5cm - \unit) -- (2 * \layer, 2.5cm) circle (\unit) -- (2 * \layer, 2.5cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (2 * \layer, 2.5cm - \myunit) -- (2 * \layer, 2.5cm) circle (\myunit) -- (2 * \layer, 2.5cm + \myunit);
|
||||
\draw (2 * \layer + 0.05cm, 2.5cm) -- (2 * \layer + 0.10cm, 2.5cm) -- (2 * \layer + 0.15cm, 2.5cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (2 * \layer, 2.5cm - 2\unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (2 * \layer, 2.5cm - 2\myunit) {$\vdots$};
|
||||
|
||||
% draw the third layer
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, -\unit) -- (3 * \layer, 0cm) circle (\unit) -- (3 * \layer, \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, -\myunit) -- (3 * \layer, 0cm) circle (\myunit) -- (3 * \layer, \myunit);
|
||||
\draw (3 * \layer + 0.05cm, 0cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {FC layer [437 units]} -- (3 * \layer + 0.10cm, 0cm) -- (3 * \layer + 0.15cm, 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (3 * \layer, 1.25 * \unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (3 * \layer, 1.25 * \myunit) {$\vdots$};
|
||||
|
||||
\foreach \x in {1.5,...,3.5} {
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, 0.5cm * \x - \unit) -- (3 * \layer, 0.5cm * \x) circle (\unit) -- (3 * \layer, 0.5cm * \x + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, 0.5cm * \x - \myunit) -- (3 * \layer, 0.5cm * \x) circle (\myunit) -- (3 * \layer, 0.5cm * \x + \myunit);
|
||||
\draw (3 * \layer + 0.05cm, 0.5cm * \x) -- (3 * \layer + 0.10cm, 0.5cm * \x) -- (3 * \layer + 0.15cm, 0.5cm * \x + 0.05cm);
|
||||
};
|
||||
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, 2.5cm - \unit) -- (3 * \layer, 2.5cm) circle (\unit) -- (3 * \layer, 2.5cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (3 * \layer, 2.5cm - \myunit) -- (3 * \layer, 2.5cm) circle (\myunit) -- (3 * \layer, 2.5cm + \myunit);
|
||||
\draw (3 * \layer + 0.05cm, 2.5cm) -- (3 * \layer + 0.10cm, 2.5cm) -- (3 * \layer + 0.15cm, 2.5cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (3 * \layer, 2.5cm - 2\unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (3 * \layer, 2.5cm - 2\myunit) {$\vdots$};
|
||||
|
||||
% draw the fourth layer
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, -0.75cm - \unit) -- (4 * \layer, -0.75cm) circle (\unit) -- (4 * \layer, -0.75cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, -0.75cm - \myunit) -- (4 * \layer, -0.75cm) circle (\myunit) -- (4 * \layer, -0.75cm + \myunit);
|
||||
\draw (4 * \layer + 0.05cm, -0.75cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {FC layer [929 units]} -- (4 * \layer + 0.10cm, -0.75cm) -- (4 * \layer + 0.15cm, -0.75cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (4 * \layer, -0.75cm + 1.25 * \unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (4 * \layer, -0.75cm + 1.25 * \myunit) {$\vdots$};
|
||||
|
||||
\foreach \x in {0,...,5} {
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, 0.5cm * \x - \unit) -- (4 * \layer, 0.5cm * \x) circle (\unit) -- (4 * \layer, 0.5cm * \x + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, 0.5cm * \x - \myunit) -- (4 * \layer, 0.5cm * \x) circle (\myunit) -- (4 * \layer, 0.5cm * \x + \myunit);
|
||||
\draw (4 * \layer + 0.05cm, 0.5cm * \x) -- (4 * \layer + 0.10cm, 0.5cm * \x) -- (4 * \layer + 0.15cm, 0.5cm * \x + 0.05cm);
|
||||
};
|
||||
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, 3.25cm - \unit) -- (4 * \layer, 3.25cm) circle (\unit) -- (4 * \layer, 3.25cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (4 * \layer, 3.25cm - \myunit) -- (4 * \layer, 3.25cm) circle (\myunit) -- (4 * \layer, 3.25cm + \myunit);
|
||||
\draw (4 * \layer + 0.05cm, 3.25cm) -- (4 * \layer + 0.10cm, 3.25cm) -- (4 * \layer + 0.15cm, 3.25cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (4 * \layer, 3.25cm - 2\unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (4 * \layer, 3.25cm - 2\myunit) {$\vdots$};
|
||||
|
||||
% draw the fifth layer
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, -\unit) -- (5 * \layer, 0cm) circle (\unit) -- (5 * \layer, \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, -\myunit) -- (5 * \layer, 0cm) circle (\myunit) -- (5 * \layer, \myunit);
|
||||
\draw (5 * \layer + 0.05cm, 0cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {FC layer [404 units]} -- (5 * \layer + 0.10cm, 0cm) -- (5 * \layer + 0.15cm, 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (5 * \layer, 1.25 * \unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (5 * \layer, 1.25 * \myunit) {$\vdots$};
|
||||
|
||||
\foreach \x in {1.5,...,3.5} {
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, 0.5cm * \x - \unit) -- (5 * \layer, 0.5cm * \x) circle (\unit) -- (5 * \layer, 0.5cm * \x + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, 0.5cm * \x - \myunit) -- (5 * \layer, 0.5cm * \x) circle (\myunit) -- (5 * \layer, 0.5cm * \x + \myunit);
|
||||
\draw (5 * \layer + 0.05cm, 0.5cm * \x) -- (5 * \layer + 0.10cm, 0.5cm * \x) -- (5 * \layer + 0.15cm, 0.5cm * \x + 0.05cm);
|
||||
};
|
||||
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, 2.5cm - \unit) -- (5 * \layer, 2.5cm) circle (\unit) -- (5 * \layer, 2.5cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (5 * \layer, 2.5cm - \myunit) -- (5 * \layer, 2.5cm) circle (\myunit) -- (5 * \layer, 2.5cm + \myunit);
|
||||
\draw (5 * \layer + 0.05cm, 2.5cm) -- (5 * \layer + 0.10cm, 2.5cm) -- (5 * \layer + 0.15cm, 2.5cm + 0.05cm);
|
||||
\node[anchor=base, scale=0.35] at (5 * \layer, 2.5cm - 2\unit) {$\vdots$};
|
||||
\node[anchor=base, scale=0.35] at (5 * \layer, 2.5cm - 2\myunit) {$\vdots$};
|
||||
|
||||
% draw the output layer
|
||||
\filldraw[fill=cyan!10, draw=black] (6 * \layer, 1.25cm - \unit) -- (6 * \layer, 1.25cm) circle (\unit) -- (6 * \layer, 1.25cm + \unit);
|
||||
\filldraw[fill=cyan!10, draw=black] (6 * \layer, 1.25cm - \myunit) -- (6 * \layer, 1.25cm) circle (\myunit) -- (6 * \layer, 1.25cm + \myunit);
|
||||
\draw (6 * \layer + 0.05cm, 1.25cm) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {output layer [1 unit]} -- (6 * \layer + 0.10cm, 1.25cm) -- (6 * \layer + 0.15cm, 1.25cm + 0.05cm);
|
||||
|
||||
% draw weights 1 --> 2 and 4 --> 5
|
||||
\foreach \x in {\layer, 4 * \layer} {
|
||||
\foreach \y in {-0.75cm, 3.25cm} {
|
||||
\foreach \z in {0cm, 2.5cm} {
|
||||
\draw (\x + \unit, \y) -- (\x + \layer - \unit, \z);
|
||||
\draw (\x + \myunit, \y) -- (\x + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {0,...,5} {
|
||||
\foreach \z in {1.5,...,3.5} {
|
||||
\draw (\x + \unit, 0.5cm * \y) -- (\x + \layer - \unit, 0.5cm * \z);
|
||||
\draw (\x + \myunit, 0.5cm * \y) -- (\x + \layer - \myunit, 0.5cm * \z);
|
||||
};
|
||||
\foreach \z in {0cm, 2.5cm} {
|
||||
\draw (\x + \unit, 0.5 * \y) -- (\x + \layer - \unit, \z);
|
||||
\draw (\x + \myunit, 0.5 * \y) -- (\x + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {1.5,...,3.5} {
|
||||
\draw (\x + \unit, 3.25cm) -- (\x + \layer - \unit, 0.5cm * \y);
|
||||
\draw (\x + \unit, -0.75cm) -- (\x + \layer - \unit, 0.5cm * \y);
|
||||
\draw (\x + \myunit, 3.25cm) -- (\x + \layer - \myunit, 0.5cm * \y);
|
||||
\draw (\x + \myunit, -0.75cm) -- (\x + \layer - \myunit, 0.5cm * \y);
|
||||
};
|
||||
};
|
||||
|
||||
% draw weights 2 --> 3
|
||||
\foreach \y in {0cm, 2.5cm} {
|
||||
\foreach \z in {0cm, 2.5cm} {
|
||||
\draw (2 * \layer + \unit, \y) -- (2 * \layer + \layer - \unit, \z);
|
||||
\draw (2 * \layer + \myunit, \y) -- (2 * \layer + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {1.5,...,3.5} {
|
||||
\foreach \z in {1.5,...,3.5} {
|
||||
\draw (2 * \layer + \unit, 0.5cm * \y) -- (2 * \layer + \layer - \unit, 0.5cm * \z);
|
||||
\draw (2 * \layer + \myunit, 0.5cm * \y) -- (2 * \layer + \layer - \myunit, 0.5cm * \z);
|
||||
};
|
||||
\foreach \z in {0cm, 2.5cm} {
|
||||
\draw (2 * \layer + \unit, 0.5cm * \y) -- (2 * \layer + \layer - \unit, \z);
|
||||
\draw (2 * \layer + \myunit, 0.5cm * \y) -- (2 * \layer + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {1.5,...,3.5} {
|
||||
\draw (2 * \layer + \unit, 2.5cm) -- (2 * \layer + \layer - \unit, 0.5cm * \y);
|
||||
\draw (2 * \layer + \unit, 0cm) -- (2 * \layer + \layer - \unit, 0.5cm * \y);
|
||||
\draw (2 * \layer + \myunit, 2.5cm) -- (2 * \layer + \layer - \myunit, 0.5cm * \y);
|
||||
\draw (2 * \layer + \myunit, 0cm) -- (2 * \layer + \layer - \myunit, 0.5cm * \y);
|
||||
};
|
||||
|
||||
% draw weights 3 --> 4
|
||||
\foreach \y in {0cm, 2.5cm} {
|
||||
\foreach \z in {-0.75cm, 3.25cm} {
|
||||
\draw (3 * \layer + \unit, \y) -- (3 * \layer + \layer - \unit, \z);
|
||||
\draw (3 * \layer + \myunit, \y) -- (3 * \layer + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {1.5,...,3.5} {
|
||||
\foreach \z in {0,...,5} {
|
||||
\draw (3 * \layer + \unit, 0.5cm * \y) -- (3 * \layer + \layer - \unit, 0.5cm * \z);
|
||||
\draw (3 * \layer + \myunit, 0.5cm * \y) -- (3 * \layer + \layer - \myunit, 0.5cm * \z);
|
||||
};
|
||||
\foreach \z in {0cm, 2.5cm} {
|
||||
\draw (3 * \layer + \unit, 0.5cm * \y) -- (3 * \layer + \layer - \unit, \z);
|
||||
\draw (3 * \layer + \myunit, 0.5cm * \y) -- (3 * \layer + \layer - \myunit, \z);
|
||||
};
|
||||
};
|
||||
\foreach \y in {0,...,5} {
|
||||
\draw (3 * \layer + \unit, 2.5cm) -- (3 * \layer + \layer - \unit, 0.5cm * \y);
|
||||
\draw (3 * \layer + \unit, 0cm) -- (3 * \layer + \layer - \unit, 0.5cm * \y);
|
||||
\draw (3 * \layer + \myunit, 2.5cm) -- (3 * \layer + \layer - \myunit, 0.5cm * \y);
|
||||
\draw (3 * \layer + \myunit, 0cm) -- (3 * \layer + \layer - \myunit, 0.5cm * \y);
|
||||
};
|
||||
|
||||
% draw weights 5 --> output
|
||||
\foreach \y in {0cm, 2.5cm} {
|
||||
\draw (5 * \layer + \unit, \y) -- (5 * \layer + \layer - \unit, 1.25cm);
|
||||
\draw (5 * \layer + \myunit, \y) -- (5 * \layer + \layer - \myunit, 1.25cm);
|
||||
};
|
||||
\foreach \y in {1.5,...,3.5} {
|
||||
\draw (5 * \layer + \unit, 0.5cm * \y) -- (5 * \layer + \layer - \unit, 1.25cm);
|
||||
\draw (5 * \layer + \myunit, 0.5cm * \y) -- (5 * \layer + \layer - \myunit, 1.25cm);
|
||||
};
|
||||
|
||||
% draw hidden layers legend
|
||||
\node[anchor=base, align=center, text width=3.5cm, scale=0.5] (h) at (4cm, 4.5cm) {hidden layers (ReLU activation)};
|
||||
\draw[->] (h) -- (\layer + \unit, 3.6cm);
|
||||
\draw[->] (h) -- (2 * \layer + \unit, 2.85cm);
|
||||
\draw[->] (h) -- (3 * \layer + 0.5 * \unit, 2.85cm);
|
||||
\draw[->] (h) -- (\layer + \myunit, 3.6cm);
|
||||
\draw[->] (h) -- (2 * \layer + \myunit, 2.85cm);
|
||||
\draw[->] (h) -- (3 * \layer + 0.5 * \myunit, 2.85cm);
|
||||
\draw[->] (h) -- (4 * \layer, 3.6cm);
|
||||
\draw[->] (h) -- (5 * \layer - 0.5 * \unit, 2.85cm);
|
||||
\draw[->] (h) -- (5 * \layer - 0.5 * \myunit, 2.85cm);
|
||||
|
||||
\end{tikzpicture}
|
||||
|
||||
% vim: ft=tex
|
||||
% vim: ft=tex
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
%\newlength{\layerheight}
|
||||
%\newlength{\perspective}
|
||||
%\newlength{\filters}
|
||||
%\newlength{\unit}
|
||||
%\newlength{\myunit}
|
||||
\newlength{\upperlevel}
|
||||
\newlength{\bottomlevel}
|
||||
\newlength{\concatheight}
|
||||
@@ -11,7 +11,7 @@
|
||||
\setlength{\layerheight}{3cm}
|
||||
\setlength{\perspective}{1cm}
|
||||
\setlength{\filters}{0.01cm}
|
||||
\setlength{\unit}{0.225cm}
|
||||
\setlength{\myunit}{0.225cm}
|
||||
\setlength{\upperlevel}{2.25cm}
|
||||
\setlength{\bottomlevel}{-2.25cm}
|
||||
\setlength{\concatheight}{0cm}
|
||||
@@ -52,8 +52,8 @@
|
||||
\node[anchor=south west, scale=0.65, rotate=45] at (2 * \layer, \concatheight + \layerheight) {$64 @ 12 \times 15$};
|
||||
|
||||
\draw (\layer + 32 * \filters + 1.2 * \perspective, \upperlevel + 0.5 * \layerheight) -- (\layer + 32 * \filters + 1.7 * \perspective, \upperlevel + 0.5 * \layerheight) -- (\layer + 32 * \filters + 1.7 * \perspective, \bottomlevel + 0.5 * \layerheight) -- (\layer + 32 * \filters + 1.2 * \perspective, \bottomlevel + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (\layer + 32 * \filters + 1.7 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\unit);
|
||||
\draw[-latex] (\layer + 32 * \filters + 1.7 * \perspective + \unit, \concatheight + 0.5 * \layerheight) -- (\layer + 32 * \filters + 1.7 * \perspective + 3 * \unit, \concatheight + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (\layer + 32 * \filters + 1.7 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\myunit);
|
||||
\draw[-latex] (\layer + 32 * \filters + 1.7 * \perspective + \myunit, \concatheight + 0.5 * \layerheight) -- (\layer + 32 * \filters + 1.7 * \perspective + 3 * \myunit, \concatheight + 0.5 * \layerheight);
|
||||
|
||||
% second layer
|
||||
\filldraw[dashed, fill=orange!20, draw=black, fill opacity=0.5] (3 * \layer, \upperlevel) -- (3 * \layer + 64 * \filters, \upperlevel) -- (3 * \layer + 64 * \filters + \perspective, \upperlevel + \perspective) -- (3 * \layer + \perspective, \upperlevel + \perspective) -- cycle;
|
||||
@@ -82,8 +82,8 @@
|
||||
\node[anchor=south west, scale=0.65, rotate=45] at (4 * \layer, \concatheight + \layerheight) {$128 @ 12 \times 15$};
|
||||
|
||||
\draw (3 * \layer + 64 * \filters + 1.1 * \perspective, \upperlevel + 0.5 * \layerheight) -- (3 * \layer + 64 * \filters + 1.6 * \perspective, \upperlevel + 0.5 * \layerheight) -- (3 * \layer + 64 * \filters + 1.6 * \perspective, \bottomlevel + 0.5 * \layerheight) -- (3 * \layer + 64 * \filters + 1.1 * \perspective, \bottomlevel + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (3 * \layer + 64 * \filters + 1.6 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\unit);
|
||||
\draw[-latex] (3 * \layer + 64 * \filters + 1.6 * \perspective + \unit, \concatheight + 0.5 * \layerheight) -- (3 * \layer + 64 * \filters + 1.6 * \perspective + 3 * \unit, \concatheight + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (3 * \layer + 64 * \filters + 1.6 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\myunit);
|
||||
\draw[-latex] (3 * \layer + 64 * \filters + 1.6 * \perspective + \myunit, \concatheight + 0.5 * \layerheight) -- (3 * \layer + 64 * \filters + 1.6 * \perspective + 3 * \myunit, \concatheight + 0.5 * \layerheight);
|
||||
|
||||
% third layer
|
||||
\filldraw[dashed, fill=orange!20, draw=black, fill opacity=0.5] (5 * \layer, \upperlevel) -- (5 * \layer + 32 * \filters, \upperlevel) -- (5 * \layer + 32 * \filters + \perspective, \upperlevel + \perspective) -- (5 * \layer + \perspective, \upperlevel + \perspective) -- cycle;
|
||||
@@ -112,23 +112,23 @@
|
||||
\node[anchor=south west, scale=0.65, rotate=45] at (6 * \layer, \concatheight + \layerheight) {$64 @ 12 \times 15$};
|
||||
|
||||
\draw (5 * \layer + 32 * \filters + 1.2 * \perspective, \upperlevel + 0.5 * \layerheight) -- (5 * \layer + 32 * \filters + 1.7 * \perspective, \upperlevel + 0.5 * \layerheight) -- (5 * \layer + 32 * \filters + 1.7 * \perspective, \bottomlevel + 0.5 * \layerheight) -- (5 * \layer + 32 * \filters + 1.2 * \perspective, \bottomlevel + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (5 * \layer + 32 * \filters + 1.7 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\unit);
|
||||
\draw[-latex] (5 * \layer + 32 * \filters + 1.7 * \perspective + \unit, \concatheight + 0.5 * \layerheight) -- (5 * \layer + 32 * \filters + 1.7 * \perspective + 3 * \unit, \concatheight + 0.5 * \layerheight);
|
||||
\filldraw[fill=red!20, draw=black] (5 * \layer + 32 * \filters + 1.7 * \perspective, \concatheight + 0.5 * \layerheight) node[anchor=center, scale=0.8] {$C$} circle (\myunit);
|
||||
\draw[-latex] (5 * \layer + 32 * \filters + 1.7 * \perspective + \myunit, \concatheight + 0.5 * \layerheight) -- (5 * \layer + 32 * \filters + 1.7 * \perspective + 3 * \myunit, \concatheight + 0.5 * \layerheight);
|
||||
|
||||
% flatten layer
|
||||
\foreach \x in {0,...,4} {
|
||||
\filldraw[fill=cyan!10, draw=black] (6 * \layer + 3cm, \concatheight + \unit + 0.75 * \x cm) circle (\unit);
|
||||
\draw (6 * \layer + 3cm + \unit, \concatheight + \unit + 0.75 * \x cm) -- (7 * \layer + 2cm - \unit, \concatheight + \unit + 0.5 * \layerheight);
|
||||
\filldraw[fill=cyan!10, draw=black] (6 * \layer + 3cm, \concatheight + \myunit + 0.75 * \x cm) circle (\myunit);
|
||||
\draw (6 * \layer + 3cm + \myunit, \concatheight + \myunit + 0.75 * \x cm) -- (7 * \layer + 2cm - \myunit, \concatheight + \myunit + 0.5 * \layerheight);
|
||||
};
|
||||
\node[anchor=north, scale=0.5, below=15pt, align=center] at (6 * \layer + 3cm, \concatheight + \unit) {flatten};
|
||||
\node[anchor=north, scale=0.5, below=15pt, align=center] at (6 * \layer + 3cm, \concatheight + \myunit) {flatten};
|
||||
|
||||
% draw the "flatenisation"
|
||||
\draw[dashed] (6 * \layer + 64 * \filters, \layerheight) -- (6 * \layer + 3 cm, 3cm + 2 * \unit) -- (6 * \layer + 64 * \filters + \perspective, \layerheight + \perspective) -- cycle;
|
||||
\draw[dashed] (6 * \layer + 64 * \filters, \layerheight) -- (6 * \layer + 3 cm, 3cm + 2 * \myunit) -- (6 * \layer + 64 * \filters + \perspective, \layerheight + \perspective) -- cycle;
|
||||
\draw[dashed] (6 * \layer + 64 * \filters, 0cm) -- (6 * \layer + 3 cm, 0cm) -- (6 * \layer + 64 * \filters + \perspective, \perspective) -- cycle;
|
||||
|
||||
% output layer
|
||||
\filldraw[fill=cyan!10, draw=black] (7 * \layer + 2cm, \concatheight + \unit + 0.5 * \layerheight - \unit) -- (7 * \layer + 2cm, \concatheight + \unit + 0.5 * \layerheight) circle (\unit) -- (7 * \layer + 2cm, \concatheight + \unit + 0.5 * \layerheight + \unit);
|
||||
\draw (7 * \layer + 2cm + 0.05cm, \concatheight + \unit + 0.5 * \layerheight) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {output layer [1 unit]} -- (7 * \layer + 2cm + 0.10cm, \concatheight + \unit + 0.5 * \layerheight) -- (7 * \layer + 2cm + 0.15cm, \concatheight + \unit + 0.5 * \layerheight + 0.05cm);
|
||||
\filldraw[fill=cyan!10, draw=black] (7 * \layer + 2cm, \concatheight + \myunit + 0.5 * \layerheight - \myunit) -- (7 * \layer + 2cm, \concatheight + \myunit + 0.5 * \layerheight) circle (\myunit) -- (7 * \layer + 2cm, \concatheight + \myunit + 0.5 * \layerheight + \myunit);
|
||||
\draw (7 * \layer + 2cm + 0.05cm, \concatheight + \myunit + 0.5 * \layerheight) node[anchor=north, below=10pt, text width=2cm, scale=0.35, align=center] {output layer [1 unit]} -- (7 * \layer + 2cm + 0.10cm, \concatheight + \myunit + 0.5 * \layerheight) -- (7 * \layer + 2cm + 0.15cm, \concatheight + \myunit + 0.5 * \layerheight + 0.05cm);
|
||||
|
||||
% draw the first convolution
|
||||
\filldraw[fill=red!50, draw=black, fill opacity=0.2] (1cm, 0.9 * \layerheight) -- (1cm + \perspective, 0.9 * \layerheight + \perspective) -- (1cm + \perspective, \layerheight + \perspective) -- (1cm, \layerheight) -- cycle;
|
||||
@@ -190,4 +190,4 @@
|
||||
|
||||
\end{tikzpicture}
|
||||
|
||||
% vim: ft=texft=texft=texft=texft=tex
|
||||
% vim: ft=texft=texft=texft=texft=tex
|
||||
|
||||
Reference in New Issue
Block a user