figure-activate.tex 4.96 KB
Newer Older
孟霞 committed
1 2 3 4 5 6 7 8
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
\draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
\foreach \x in {-1.0,-0.5,0.0,0.5,1.0}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){\x};}
 \foreach \y in {1.0,0.5}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(0,\y){\y};}
\draw[color=red ,domain=-1.4:1, line width=1pt]plot(\x,{ln(1+(exp(\x))});
孟霞 committed
9
\node[black,anchor=south] at (0,1.6) {\small $y = \ln(1+{\textrm e}^x)$};
孟霞 committed
10
\node [anchor=south east,inner sep=1pt] (labela) at (0.8,-2) {\small{(a) Softplus}};
孟霞 committed
11 12 13
\end{scope}

%%%------------------------------------------------------------------------------------------------------------
孟霞 committed
14
\begin{scope}[xshift=1.7in]
孟霞 committed
15 16 17

\draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
\draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
孟霞 committed
18
\draw[dashed](0,1)--(1.4,1);
孟霞 committed
19 20 21
\foreach \x in {-1,-0.5,0,0.5,1}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){
      \pgfmathparse{(\x)*5}
      \pgfmathresult};}
孟霞 committed
22
\foreach \y in {0.5,1.0}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(-0.15,\y){\y};}
孟霞 committed
23
\draw[color=red,domain=-1.4:1.4, line width=1pt]plot(\x,{1/(1+(exp(-5*\x)))});
孟霞 committed
24
\node[black,anchor=south] at (0,1.6) {\small $y = \frac{1}{1+{\textrm e}^{-x}}$};
孟霞 committed
25
\node [anchor=south east,inner sep=1pt] (labelb) at (0.8,-2) {\small{(b) Sigmoid}};
孟霞 committed
26 27 28
\end{scope}
%%%------------------------------------------------------------------------------------------------------------

孟霞 committed
29
\begin{scope}[xshift=3.4in]
孟霞 committed
30 31
 \draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
        \draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
孟霞 committed
32 33
        \draw[dashed](0,1)--(1.4,1);
        \draw[dashed](-1.4,-1)--(0,-1);
孟霞 committed
34
        \foreach \x in {-1.0,-0.5,0.0,0.5,1.0}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){\x};}
孟霞 committed
35
        \foreach \y in {,-1.0-0.5,0.5,1.0}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(0,\y){\y};}
孟霞 committed
36
        \draw[color=red ,domain=-1.4:1.4, line width=1pt]plot(\x,{tanh(\x)});
孟霞 committed
37
        \node[black,anchor=south] at (0,1.6) {\small $y = \frac{{\textrm e}^{x}-{\textrm e}^{-x}}{{e}^{x}+e^{-x}}$};
孟霞 committed
38
\node [anchor=south east,inner sep=1pt] (labelc) at (0.8,-2) {\small{(c) Tanh}};
孟霞 committed
39 40 41 42
\end{scope}

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

孟霞 committed
43
\begin{scope}[yshift=-1.8in]
孟霞 committed
44 45 46 47 48
  \draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
        \draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
        \foreach \x in {-1.0,-0.5,0.0,0.5,1.0}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){\x};}
        \foreach \y in {0.5,1.0}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(0,\y){\y};}
        \draw[color=red ,domain=-1.4:1.4, line width=1pt]plot(\x,{max(\x,0)});
孟霞 committed
49
        \node[black,anchor=south] at (0,1.6) {\small $y =\max (0, x)$};
孟霞 committed
50
\node [anchor=south east,inner sep=1pt] (labeld) at (0.8,-2) {\small{(d) ReLU}};
孟霞 committed
51 52 53
\end{scope}

%%%------------------------------------------------------------------------------------------------------------
孟霞 committed
54
\begin{scope}[yshift=-1.8in,xshift=1.7in]
孟霞 committed
55 56 57
        \draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
        \draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
        \foreach \x in {-1.0,-0.5,0.0,0.5,1.0}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){\x};}
孟霞 committed
58
        \foreach \y in {0.5,1.0}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(-0.15,\y){\y};}
孟霞 committed
59
        \draw[color=red ,domain=-1.4:1.4, line width=1pt]plot(\x,{exp(-1*((\x)^2))});
孟霞 committed
60
        \node[black,anchor=south] at (0,1.6) {\small $y =e^{-x^2}$};
孟霞 committed
61
\node [anchor=south east,inner sep=1pt] (labele) at (0.8,-2) {\small{(e) Gaussian}};
孟霞 committed
62 63 64
\end{scope}

%%%------------------------------------------------------------------------------------------------------------
孟霞 committed
65
\begin{scope}[yshift=-1.8in,xshift=3.4in]
孟霞 committed
66 67 68 69 70
        \draw[->, line width=1pt](-1.4,0)--(1.4,0)node[left,below,font=\scriptsize]{$x$};
        \draw[->, line width=1pt](0,-1.4)--(0,1.4)node[right,font=\scriptsize]{$y$};
        \foreach \x in {-1.0,-0.5,0.0,0.5,1.0}{\draw(\x,0)--(\x,0.05)node[below,outer sep=2pt,font=\scriptsize]at(\x,0){\x};}
        \foreach \y in {0.5,1.0}{\draw(0,\y)--(0.05,\y)node[left,outer sep=2pt,font=\scriptsize]at(0,\y){\y};}
        \draw[color=red ,domain=-1:1, line width=1pt]plot(\x,\x);
孟霞 committed
71
        \node[black,anchor=south] at (0,1.6) {\small $y =x$};
孟霞 committed
72
\node [anchor=south east,inner sep=1pt] (labelf) at (0.8,-2) {\small{(f) Identity}};
孟霞 committed
73 74 75
\end{scope}
\end{tikzpicture}
%%%------------------------------------------------------------------------------------------------------------