MoustafaAMahmoud / Learning_meters_of_Arabic_with_DNN

mostafa alaa master thsis
0 stars 1 forks source link

Add figure for background #1

Closed MoustafaAMahmoud closed 5 years ago

MoustafaAMahmoud commented 5 years ago

%%%%%%%%%%%%%%%Resource https://www.latex4technics.com/?note=nnje4t http://mirrors.ibiblio.org/CTAN/graphics/pgf/contrib/tikz-timing/tikz-timing.pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.304.5533&rep=rep1&type=pdf http://siam.cs.kuleuven.be/sites/siam.cs.kuleuven.be/files/events/tikz_workshop/tikz_introduction.pdf https://www.bu.edu/math/files/2013/08/tikzpgfmanual.pdf

\documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}% [ grid=major,
xmin=-6, xmax=6, axis x line=bottom, ytick={0,.5,1}, ymax=1, axis y line=middle, ] \addplot% [ blue,% mark=none, samples=100, domain=-6:6, ] (x,{1/(1+exp(-x))}); \end{axis} \end{tikzpicture} \end{document}

\documentclass[varwidth=false, border=2pt]{standalone}

\usepackage{pgfplots} \usepackage{tikz}

\begin{document} \begin{tikzpicture} \begin{axis}[ legend pos=north west, axis x line=middle, axis y line=middle, x tick label style={/pgf/number format/fixed, /pgf/number format/fixed zerofill, /pgf/number format/precision=1}, y tick label style={/pgf/number format/fixed, /pgf/number format/fixed zerofill, /pgf/number format/precision=1}, grid = major, width=16cm, height=8cm, grid style={dashed, gray!30}, xmin=-1, % start the diagram at this x-coordinate xmax= 1, % end the diagram at this x-coordinate ymin= 0, % start the diagram at this y-coordinate ymax= 1, % end the diagram at this y-coordinate %axis background/.style={fill=white}, xlabel=x, ylabel=y, tick align=outside, enlargelimits=false] % plot the stirling-formulae \addplot[domain=-1:1, red, ultra thick,samples=500] {1/(1+exp(-5x))}; \addplot[domain=-1:1, blue, ultra thick,samples=500] {1/(1+exp(-10x))}; \addlegendentry{$f(x)=\frac{1}{1+e^{-5x}}$} \addlegendentry{$g(x)=\frac{1}{1+e^{-10x}}$} \end{axis} \end{tikzpicture} \end{document}

%%%%%%%%%%%%RELU

\documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ domain=-3:5, ] \addplot+[mark=none,red,domain=-3:0] {0}; \addplot+[mark=none,red,domain=0:5] {x}; \end{axis} \end{tikzpicture} \end{document}

\documentclass[border=5pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ domain=-3:5, ] \addplot { ifthenelse( x<0, % if x^2, % then x % else ) }; \end{axis} \end{tikzpicture} \end{document} %%%%%%%%%%%%%%%%%%%%%Tanh with Sgimoid

\documentclass[11pt]{article}

\usepackage{subfigure} \usepackage{pgfplots} \usepackage[top=3cm,left=3cm,right=3cm,bottom=3cm]{geometry} % Scriptsize axis style. \pgfplotsset{every axis/.append style={tick label style={/pgf/number format/fixed},font=\scriptsize,ylabel near ticks,xlabel near ticks,grid=major}}

\begin{document} \begin{figure}[t!] \centering \subfigure[Logistic sigmoid activation function.]{ \begin{tikzpicture} \begin{axis}[width=5.5cm,height=4cm,ylabel=$\sigma(z)$,xlabel=$z$,ymin=0,ymax=1.25,xmin=-5,xmax=5] \addplot[blue,smooth] {1/(1+exp(-x))}; \addlegendentry{Logistic sigmoid} \end{axis} \end{tikzpicture} } \subfigure[Hyperbolic tangent activation function.]{ \begin{tikzpicture} \begin{axis}[width=5.5cm,height=4cm,ylabel=$\tanh(z)$,xlabel=$z$,ymin=-1.25,ymax=1.25,xmin=-5,xmax=5] \addplot[blue,smooth] {tanh(x)}; \addlegendentry{Hyperbolic tangent} \end{axis} \end{tikzpicture} }\ \subfigure[Logistic sigmoid activation function.]{ \begin{tikzpicture} \begin{axis}[width=5.5cm,height=4cm,ylabel=$s(z)$,xlabel=$z$,ymin=0,ymax=1.25,xmin=-5,xmax=5] \addplot[blue,smooth] {1/(1 + abs(x))}; \addlegendentry{Softsign} \end{axis} \end{tikzpicture} } \subfigure[Rectified hyperbolic tangent activation function.]{ \begin{tikzpicture} \begin{axis}[width=5.5cm,height=4cm,ylabel=$|\tanh(z)|$,xlabel=$z$,ymin=0,ymax=1.25,xmin=-5,xmax=5] \addplot[blue,smooth] {abs(tanh(x))}; \addlegendentry{Rectified $\tanh$} \end{axis} \end{tikzpicture} } \caption[Sigmoidal activation functions.]{Common used activation functions include the logistic sigmoid $\sigma(z)$ and the hyperbolic tangent $tanh(z)$. More recently used activation functions are the softsign and the rectified hyperbolic tangent.} \label{fig:sigmoid-tanh} \end{figure} \end{document}

%%%%%%%%%%%%%%%%%%%%%%%%% Linear function

\addplot table[y={create col/linear regression={y=Y}}]{ X Y 1.0 0.816286793 1.5 0.81474159 2.0 0.77101728 2.5 0.733906267 3.0 0.693063823 4.0 0.660231965 5.0 0.62408223 6.0 0.627902353 };

\documentclass[12pt]{article} \usepackage{pgfplotstable}% loads pgfplots, tikz, graphicx \pgfplotsset{compat=1.14}% <- added!

\begin{document} \begin{figure} \centering \begin{tikzpicture} % one table for all plots \pgfplotstableread{ X Y1 Y2 Y3 Y4 1.0 0.816286793 0.825289956 0.861302609 0.862803136 1.5 0.81474159 0.808615713 0.852722025 0.863136015 2.0 0.77101728 0.77101728 0.81911744 0.824776283 2.5 0.733906267 0.731375556 0.685822753 0.682026686 3.0 0.693063823 0.662742281 0.675737228 0.679202547 4.0 0.660231965 0.657230911 0.681239346 0.676737764 5.0 0.62408223 0.657635038 0.657635038 0.669714049 6.0 0.627902353 0.661594675 0.66281985 0.669558314 }\data

    \begin{axis}[
      x post scale=2, y post scale=1.5,
      xlabel=Injection Pressure (Bar) ,
      ylabel=Coefficient Discharge,
      xmin=0, xmax=7,
      ymin=0.5, ymax=1,
      regline/.style={dashed,forget plot}
      ]
        \addlegendentry{1/4 Lift}
    \addplot [color=blue,mark=o, smooth] table [y=Y1] {\data};
    \addplot [blue,regline] table [y={create col/linear regression={y=Y1}}] {\data};
        \addlegendentry{1/2 Lift}
    \addplot [color=red,mark=triangle, smooth] table [y=Y2] {\data};
    \addplot [red,regline] table [y={create col/linear regression={y=Y2}}] {\data};
        \addlegendentry{3/4 Lift}
    \addplot [color=green,mark=10-pointed star, smooth] table [y=Y3] {\data};
    \addplot [green,regline] table [y={create col/linear regression={y=Y3}}] {\data};
        \addlegendentry{Full Lift}
    \addplot [color=yellow,mark=+, smooth] table [y=Y4] {\data};
    \addplot [yellow,regline] table [y={create col/linear regression={y=Y4}}] {\data};
    \end{axis}%
\end{tikzpicture}%
\caption{Cd vs Re for straight nozzle}
\end{figure}

\end{document}

%%%http://www.texample.net/tikz/examples/linear-regression/ %%%https://commons.wikimedia.org/wiki/Category:TikZ_diagrams

%%%%%%%%%%%%%%%%%%%%%%%Gradient decent %%https://github.com/davidstutz/latex-resources/blob/master/tikz-gradient-descent/gradient-descent.tex

%%% Lamda http://www.leg.ufpr.br/~walmes/tikz/

%%%% The above biological model can be translated into an Artificial Neural Network as described in figure XXXX. %@@@ add figure for neuron input format here

%%% Neural Network Example: Neural network http://www.texample.net/tikz/examples/neural-network/ https://tex.stackexchange.com/questions/443821/how-to-a-draw-branch-of-a-backpropagation-neural-network https://tex.stackexchange.com/questions/153957/drawing-neural-network-with-tikz

%%%% Backpropagation https://tex.stackexchange.com/questions/393323/help-drawing-a-back-propagation-neural-network-architecture-with-the-given-code https://tex.stackexchange.com/questions/40718/neural-network-representation https://github.com/davidstutz/seminar-neural-networks/blob/master/neural-network.tex

%%%% RNN https://tex.stackexchange.com/questions/364413/drawing-an-unfolded-recurrent-neural-network

%%%% LSTM https://tex.stackexchange.com/questions/432312/how-do-i-draw-an-lstm-cell-in-tikz https://github.com/mila-udem/summerschool2015/blob/master/rnn_tutorial/slides_source/rnn_lstm.tex https://www.latex4technics.com/?note=nnje4t

TahaMagdy commented 5 years ago

أنا مش فاهم أى حاجة يبشمهندس :"D

MoustafaAMahmoud commented 5 years ago

فاكس ده كنت قاعد بتعلم أو بدور على النت على شوية رسومات وانت في. الشغل ولاقيتهم قلت احطهم في أي حاجة لغاية لما أروح

TahaMagdy commented 5 years ago

طيب بص، إحنا ممكن نعد بكرة إن شاء الله؟ لو عايز حجات لاتك هل يناسبك؟

MoustafaAMahmoud commented 5 years ago

Sure, Anytime; It is all related to plotting using Latex

TahaMagdy commented 5 years ago

جميل نظبط ع وتساب بءا

MoustafaAMahmoud commented 5 years ago

I am available today night