figure-tensor-mul.tex 5.51 KB
Newer Older
孟霞 committed
1 2 3 4 5 6
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}

\begin{scope}[yshift=6.5em,xshift=1em]
{
\setcounter{mycount1}{1}
孟霞 committed
7
\draw[step=0.5cm,color=orange!70,thick] (-1,-1) grid (1,1);
孟霞 committed
8 9
\foreach \y in {+0.75,+0.25,-0.25,-0.75}
  \foreach \x in {-0.75,-0.25,0.25,0.75}{
孟霞 committed
10
    \node [fill=orange!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount1}$};
孟霞 committed
11 12 13 14 15 16 17 18 19
    \addtocounter{mycount1}{1};
  }
}
\node [anchor=south west] (label11) at (-1.3,0.9) {\footnotesize{\ding{172}}};
\end{scope}

\begin{scope}[yshift=6em,xshift=0.5em]
{
\setcounter{mycount2}{2}
孟霞 committed
20
\draw[step=0.5cm,color=blue!70,thick] (-1,-1) grid (1,1);
孟霞 committed
21 22
\foreach \y in {+0.75,+0.25,-0.25,-0.75}
  \foreach \x in {-0.75,-0.25,0.25,0.75}{
孟霞 committed
23
    \node [fill=blue!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount2}$};
孟霞 committed
24 25 26 27 28 29 30 31 32
    \addtocounter{mycount2}{1};
  }
}
\node [anchor=south west] (label12) at (-1.3,0.9) {\footnotesize{\ding{173}}};
\end{scope}

\begin{scope}[yshift=5.5em,xshift=0em]
{
\setcounter{mycount3}{3}
孟霞 committed
33
\draw[step=0.5cm,color=ugreen!70,thick] (-1,-1) grid (1,1);
孟霞 committed
34 35
\foreach \y in {+0.75,+0.25,-0.25,-0.75}
  \foreach \x in {-0.75,-0.25,0.25,0.75}{
孟霞 committed
36
    \node [fill=green!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount3}$};
孟霞 committed
37 38 39 40 41 42 43 44 45
    \addtocounter{mycount3}{1};
  }
}
\node [anchor=south west] (label13) at (-1.3,0.9) {\footnotesize{\ding{174}}};
\end{scope}

\begin{scope}[yshift=5em,xshift=-0.5em]
{
\setcounter{mycount4}{4}
孟霞 committed
46
\draw[step=0.5cm,color=red!70,thick] (-1,-1) grid (1,1);
孟霞 committed
47 48
\foreach \y in {+0.75,+0.25,-0.25,-0.75}
  \foreach \x in {-0.75,-0.25,0.25,0.75}{
孟霞 committed
49
    \node [fill=red!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount4}$};
孟霞 committed
50 51
    \addtocounter{mycount4}{1};
  }
孟霞 committed
52
\node [anchor=north] (xlabel) at (0,-1.2) {$\mathbi{x}$};
孟霞 committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
}
\node [anchor=south west] (label14) at (-1.3,0.9) {\footnotesize{\ding{175}}};
\end{scope}

\begin{scope}[yshift=5em,xshift=1.5in]
{
\draw[step=0.5cm,thick] (-0.5,-1) grid (0.5,1.0);
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (-0.25,0.75) {\small{$-1$}};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (-0.25,0.25) {$0$};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (-0.25,-0.25) {$1$};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (-0.25,-0.75) {$0$};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,0.75) {$0$};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,0.25) {\small{$-1$}};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.25) {$1$};
\node [fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.75) {$0$};
孟霞 committed
68
\node [anchor=north] (xlabel) at (0,-1.2) {$\mathbi{W}$};
孟霞 committed
69 70 71 72 73 74 75 76 77 78
}

{\draw [->,thick,dashed] (-1.5in+2em+1.5em,-0.3) .. controls +(east:2) and +(west:1) .. (-0.55,0.8) node [pos=0.5,left] {\scriptsize{\textbf{矩阵乘}}};}
{\draw [->,thick,dashed] (-1.5in+2em+1.0em,-0.5) .. controls +(east:2) and +(west:1) .. (-0.55,0.8) ;}
{\draw [->,thick,dashed] (-1.5in+2em+0.5em,-0.7) .. controls +(east:2.5) and +(west:1) .. (-0.55,0.8) ;}
{\draw [->,thick,dashed] (-1.5in+2em,-0.9) .. controls +(east:3) and +(west:1) .. (-0.55,0.8);}
\end{scope}

\begin{scope}[yshift=6.5em,xshift=1em+3in]
{
孟霞 committed
79
\draw[step=0.5cm,color=orange!70,thick] (-0.5,-1) grid (0.5,1.0);
孟霞 committed
80 81 82
\foreach \y in {+0.75,+0.25,-0.25,-0.75}{
  \setcounter{mycount1}{2}
  \foreach \x in {-0.25,0.25}{
孟霞 committed
83
    \node [fill=orange!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount1}$};
孟霞 committed
84 85 86 87 88 89 90 91 92
    \addtocounter{mycount1}{-1};
  }
}
}
\node [anchor=south west] (label21) at (-0.8,0.9) {\footnotesize{\ding{172}}};
\end{scope}

\begin{scope}[yshift=6em,xshift=0.5em+3in]
{
孟霞 committed
93
\draw[step=0.5cm,color=blue!70,thick] (-0.5,-1) grid (0.5,1.0);
孟霞 committed
94 95 96
\foreach \y in {+0.75,+0.25,-0.25,-0.75}{
  \setcounter{mycount1}{2}
  \foreach \x in {-0.25,0.25}{
孟霞 committed
97
    \node [fill=blue!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount1}$};
孟霞 committed
98 99 100 101 102 103 104 105 106
    \addtocounter{mycount1}{-1};
  }
}
}
\node [anchor=south west] (label22) at (-0.8,0.9) {\footnotesize{\ding{173}}};
\end{scope}

\begin{scope}[yshift=5.5em,xshift=0em+3in]
{
孟霞 committed
107
\draw[step=0.5cm,color=ugreen!70,thick] (-0.5,-1) grid (0.5,1.0);
孟霞 committed
108 109 110
\foreach \y in {+0.75,+0.25,-0.25,-0.75}{
  \setcounter{mycount1}{2}
  \foreach \x in {-0.25,0.25}{
孟霞 committed
111
    \node [fill=green!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount1}$};
孟霞 committed
112 113 114 115 116 117 118 119 120
    \addtocounter{mycount1}{-1};
  }
}
}
\node [anchor=south west] (label23) at (-0.8,0.9) {\footnotesize{\ding{174}}};
\end{scope}

\begin{scope}[yshift=5.0em,xshift=-0.5em+3in]
{
孟霞 committed
121
\draw[step=0.5cm,color=red!70,thick] (-0.5,-1) grid (0.5,1.0);
孟霞 committed
122 123 124
\foreach \y in {+0.75,+0.25,-0.25,-0.75}{
  \setcounter{mycount1}{2}
  \foreach \x in {-0.25,0.25}{
孟霞 committed
125
    \node [fill=red!15,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (\x,\y) {$\number\value{mycount1}$};
孟霞 committed
126 127 128 129 130 131
    \addtocounter{mycount1}{-1};
  }
}
}
\node [anchor=south west] (label24) at (-0.8,0.9) {\footnotesize{\ding{175}}};
{
孟霞 committed
132
\node [anchor=north] (xlabel) at (0,-1.2) {${\mathbi{x}} \cdot {\mathbi{W}}$};
孟霞 committed
133 134 135 136 137 138 139 140
\node [anchor=center] (elabel) at (-0.7in,0) {\Huge{$\textbf{=}$}};
}
\end{scope}

\end{tikzpicture}

%%------------------------------------------------------------------------------------------------------------