\begin{frame}
	\myheading{Module 2.2: McCulloch Pitts Neuron}
\end{frame}


\begin{frame}
	\begin{columns}
		\column{0.4\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{figure}
				\input{modules/Module2/tikz_images/generic_computing_unit}
				%\caption{A generic computing unit}
			\end{figure}

		\end{overlayarea}
		\column{0.6\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{itemize}\justifying
				\item McCulloch (neuroscientist) and Pitts (logician) proposed a highly simplified computational model of the neuron (1943)
				\item<7-> $g$ aggregates the inputs \onslide<8->{and the function $f$ takes a decision based on this aggregation}
				\item<10-> The inputs can be excitatory or inhibitory
				\item<11-> $y = 0$ if any $x_i$ is inhibitory, else

				      \onslide<12->{
					      \begin{align*}
						      \onslide<12->{g(x_1, x_2, ..., x_n) & = g(\mathbf{x}) = \sum_{i=1}^{n} x_i \\}
						      \onslide<13->{y = f (g(\mathbf{x})) & = 1 \quad if \quad g(\mathbf{x}) \geq \theta \\}
						      \onslide<14->{                      & = 0 \quad if \quad g(\mathbf{x}) < \theta}
					      \end{align*}
				      }

				      \vspace{-0.4in}
				\item<15-> $\mathbf{\theta}$ is called the thresholding parameter
				\item<16-> This is called Thresholding Logic
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	Let us implement some boolean functions using this McCulloch Pitts (MP) neuron ...
\end{frame}


\begin{frame}
	\begin{columns}
		\column{0.33\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\input{modules/Module2/tikz_images/mp_unit}
				\captionof{figure}{A McCulloch Pitts unit}

				\only<6->{
					\input{modules/Module2/tikz_images/x_and_not_y}
					\captionof{figure}{$x_1$ AND $!x_2$$^*$ \footnotetext{$^*$circle at the end indicates inhibitory input: if any inhibitory input is 1 the output will be 0}}
				}
			\end{center}

		\end{overlayarea}

		\column{0.33\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\only<2->{
					\input{modules/Module2/tikz_images/and}
					\captionof{figure}{AND function}
				}
				\only<8->{
					\input{modules/Module2/tikz_images/nor}
					\captionof{figure}{NOR function}
				}
			\end{center}
		\end{overlayarea}

		\column{0.33\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\only<4->{
					\input{modules/Module2/tikz_images/or}
					\captionof{figure}{OR function}
				}

				\only<10->{
					\input{modules/Module2/tikz_images/not}
					\captionof{figure}{NOT function}
				}
			\end{center}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{itemize}\justifying
		\item Can any boolean function be represented using a McCulloch Pitts unit ?
		\item<2-> Before answering this question let us first see the geometric interpretation of a MP unit ...
	\end{itemize}
\end{frame}


\begin{frame}
	\begin{columns}
		\column{0.4\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\only<1->{
					\input{modules/Module2/tikz_images/or_2}
					\centering
					\captionof{figure}{OR function \\ $x_1 + x_2 = \sum_{i=1}^{2} x_i \geq 1$ }
				}

				\only<2->{
					\input{modules/Module2/tikz_images/line_equation}
				}
			\end{center}
		\end{overlayarea}
		\column{0.6\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{itemize}\justifying
				\item<4-> A single MP neuron splits the input points (4 points for 2 binary inputs) into two halves
				\item<5-> Points lying on or above the line $\sum_{i=1}^{n} x_i - \theta = 0$ and points lying below this line
				\item<6-> In other words, all inputs which produce an output 0 will be on one side ($\sum_{i=1}^{n} x_i < \theta$) of the line and all inputs which produce an  output 1 will lie on the other side ($\sum_{i=1}^{n} x_i \geq \theta$) of this line
				\item<7-> Let us convince ourselves about this with a few more examples (if it is not already clear from the math)
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}


\begin{frame}
	\begin{columns}
		\column{0.4\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\only<1->{
					\input{modules/Module2/tikz_images/and_2}
					\captionof{figure}{AND function \\ $x_1 + x_2 = \sum_{i=1}^{2} x_i \geq 2$ }
				}
				\only<2->{
					\vspace{-0.2in}
					\input{modules/Module2/tikz_images/line_equation_and}
				}
			\end{center}
		\end{overlayarea}
		\column{0.6\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\only<4->{
					\input{modules/Module2/tikz_images/tautology}
					\captionof{figure}{Tautology (always ON)}
				}

				\only<6->{
					\input{modules/Module2/tikz_images/line_equation_tautology}
				}
			\end{center}
		\end{overlayarea}
	\end{columns}
\end{frame}


\begin{frame}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{center}
				\input{modules/Module2/tikz_images/or_3_noonslide}

				\only<2->{
					\input{modules/Module2/tikz_images/or_plane}
				}
			\end{center}
		\end{overlayarea}

		\column{0.5\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{itemize}\justifying
				\item<1-> What if we have more than 2 inputs?
				\item<3-> Well, instead of a line we will have a plane
				\item<4-> For the OR function, we want a plane such that the point (0,0,0) lies on one side and the remaining 7 points lie on the other side of the plane

			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}


\begin{frame}
	\begin{block}{The story so far ...}
		\onslide<1->{
			\begin{itemize}\justifying
				\item<1-> A single McCulloch Pitts Neuron can be used to represent boolean functions which are linearly separable
				\item<2-> Linear separability (for boolean functions) : There exists a line (plane) such that all inputs which produce a 1 lie on one side of the line (plane) and all inputs which produce a 0 lie on other side of the line (plane)
			\end{itemize}
		}
	\end{block}
\end{frame}
