I am trying to do draw the below image using LatexDraw but was having difficulty rendering it. It would be really helpful to get pointers on how to use TikZ to generate the following figure.
Below is the code
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{amsmath,bm,times}
\newcommand{\mx}[1]{\mathbf{\bm{#1}}} % Matrix command
\newcommand{\vc}[1]{\mathbf{\bm{#1}}} % Vector command
\begin{document}
\begin{tikzpicture}
% Method 2 overlapping nodes
\node[rotate=90, fill=gray!20,
minimum height=2em, text width=6em,rounded corners, drop shadow] at (3,1.5) { \hspace{0.5em}Input Layer};
\node[rotate=90, fill=red!20,
minimum height=2em, text width=8em,rounded corners, drop shadow] at (5,1.5) { \hspace{1em}Shared Layer};
\node[draw, minimum size=0.5cm, fill=blue!20] at (7,0.5) {};
\node[draw, minimum size=0.5cm, fill=green!20] at (7,1.5) {};
\node[draw, minimum size=0.5cm, fill=yellow!20] at (7,2.5) {};
\node[text width=8em] at (7.5,3.5) {Task Specific \\ \hspace{0.6em} Layer};
\node(n1)[draw, minimum size=0.5cm, fill=blue!20] at (9,0.5) {} ;
\node(n2)[draw, minimum size=0.5cm, fill=green!20] at (9,1.5) {} ;
\node(n3)[draw, minimum size=0.5cm, fill=yellow!20] at (9,2.5) {} ;
\node[text width=8em] at (10,3.5) {Output \\ \hspace{0.1em} Layer};
\node (1) [right = of n1] {Task 3};
\draw [->] (n1) -- (1);
\node (1) [right = of n2] {Task 2};
\draw [->] (n2) -- (1);
\node (1) [right = of n3] {Task 1};
\draw [->] (n3) -- (1);
\end{tikzpicture}
\end{document}
and the output is
How do I add dotted crossed lines?
Best Answer
As starting point: