\documentclass[10pt]{beamer}

% for themes, etc.
\mode<presentation>
{ \usetheme{default} }
%{ \usetheme{boxes} }

\usepackage{times}  % fonts are up to you
\usepackage{graphics}
\usepackage{amsmath}
\definecolor{red}{rgb}{0.5,0.0,0.0}
\renewcommand{\emph}[1]{\textcolor{red}{\em\bf #1}}

% these will be used later in the title page
\title{Fundamentals of Computational Neuroscience 2e}
%\author{Thomas Trappenberg}


\begin{document}

%%%%%%%%%%%% Slide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\titlepage

\date{\today}

\begin{center} {Chapter 7: Cortical maps and competitive population coding} \end{center}


\end{frame}
%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Tuning Curves}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/tuningCurve.pdf}}
\end{center}

\end{frame}
%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Self-organizing maps (SOMs)}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/som_model1.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Network equations}

\emph{Update rule of (recurrent) cortical network: }
$$ {\tau} \frac{{\rm d}u_i(t)}{{\rm d}t}=-u_i(t)+ \frac{1}{N} \sum_j
w_{ij} r_j(t) + \frac{1}{M} \sum_k w^{\rm in}_{ik} r^{\rm in}_k(t)$$

\emph{Activation function: } $
r_j(t) = \frac{1}{1+e^{\beta (u_j(t) - \alpha)}}.
$

\emph{Lateral weight matrix: } $w_{ij}  \propto   r_i r_j   $
$$=   A_{\rm w} \left( {\rm e}^{-((i-j)*\Delta x)^2 / 2\sigma^2} -C \right)
$$

\emph{Input weight matrix: } $ w_{ij}^{\rm in} \propto   r_i r^{\rm in}_j$
\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Shortcut}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/som_model2.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\frame[containsverbatim] { \frametitle{\large som.m}
\scriptsize

\begin{verbatim}
 1   %% Two dimensional self-organizing feature map al la Kohonen
 2    clear; nn=10; lambda=0.2; sig=2; sig2=1/(2*sig^2);
 3    [X,Y]=meshgrid(1:nn,1:nn); ntrial=0;
 4
 5    % Initial centres of prefered features:
 6    c1=0.5-.1*(2*rand(nn)-1);
 7    c2=0.5-.1*(2*rand(nn)-1);
 8
 9   %% training session
10    while(true)
11       if(mod(ntrial,100)==0) % Plot grid of feature centres
12           clf; hold on; axis square; axis([0 1 0 1]);
13           plot(c1,c2,'k'); plot(c1',c2','k');
14           tstring=[int2str(ntrial) ' examples']; title(tstring);
15           waitforbuttonpress;
16       end
17       r_in=[rand;rand];
18       r=exp(-(c1-r_in(1)).^2-(c2-r_in(2)).^2);
19       [rmax,x_winner]=max(max(r)); [rmax,y_winner]=max(max(r'));
20       r=exp(-((X-x_winner).^2+(Y-y_winner).^2)*sig2);
21       c1=c1+lambda*r.*(r_in(1)-c1);
22       c2=c2+lambda*r.*(r_in(2)-c2);
23       ntrial=ntrial+1;
24    end

\end{verbatim}

}


%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large SOM simulation}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/som_sim1b.pdf}} 
\end{center}

\end{frame} 



%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Another example}

\begin{center}
\resizebox{11cm}{!}{\includegraphics{figures/Chapter7/som_sim2b.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large  Zhou and Merzenich, PNAS 2007}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/som_a1.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Dynamic Neural Field Theory}

\emph{Field dynamics: }
$$ \tau \frac{\partial \mathbf{u}(\mathbf{x},t)}{\partial t} = - \mathbf{u}(\mathbf{x},t)+ \int_\mathbf{y}
\mathbf{w}(\mathbf{x},\mathbf{y})\mathbf{r}(\mathbf{y},t) {\rm d}\mathbf{y} +I^{\rm ext}(\mathbf{x},t) 
$$

$$
\mathbf{r}(\mathbf{x},t) = g(\mathbf{u}(\mathbf{x},t)),
$$

Continuous version of equations above with discretization:  
$$x \rightarrow i \Delta x \;\; \mbox{and} \;\; \int {\rm d}x \rightarrow \Delta x \sum $$


\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Lateral weight kernel}

\begin{center}
$$\mathbf{w}^{\rm E}(|x-y|) = A_{\rm w} {\rm e}^{-(x-y)^2/4{\sigma_r}^2}$$

{\small Can be learned from Gaussian response curves of individual nodes}

\resizebox{5cm}{!}{\includegraphics{figures/Chapter7/DNFweightkernel.pdf}} 
\resizebox{4.5cm}{!}{\includegraphics{figures/Chapter7/DNFweightkernelSC.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Self-sustained activity packet}

\begin{center}
\resizebox{6cm}{!}{\includegraphics{figures/Chapter7/cann_sim1.pdf}} 
\resizebox{4cm}{!}{\includegraphics{figures/Chapter7/cann_sim1b.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large DNF example}

\begin{center}
\resizebox{4cm}{!}{\includegraphics{figures/Chapter7/DNFexampleWM.pdf}} 
\hspace*{1cm}
\resizebox{5cm}{!}{\includegraphics{figures/Chapter7/DNFexamplePlaceField.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\frame[containsverbatim] { \frametitle{\large dnf.m}
\footnotesize

\begin{verbatim}
 1   %% Dynamic Neural Field Model (1D)
 2    clear; clf; hold on;
 3    nn = 100; dx=2*pi/nn; sig = 2*pi/10; C=0.5;
 4
 5   %% Training weight matrix
 6    for loc=1:nn;
 7        i=(1:nn)'; dis= min(abs(i-loc),nn-abs(i-loc));
 8        pat(:,loc)=exp(-(dis*dx).^2/(2*sig^2));
 9    end
10    w=pat*pat'; w=w/w(1,1); w=4*(w-C);
11   %% Update with localised input
12    tall = []; rall = [];
13    I_ext=zeros(nn,1); I_ext(nn/2-floor(nn/10):nn/2+floor(nn/10))=1;
14    [t,u]=ode45('rnn_ode',[0 10],zeros(1,nn),[],nn,dx,w,I_ext);
15    r=1./(1+exp(-u)); tall=[tall;t]; rall=[rall;r];
16   %% Update without input
17    I_ext=zeros(nn,1);
18    [t,u]=ode45('rnn_ode',[10 20],u(size(u,1),:),[],nn,dx,w,I_ext);
19    r=1./(1+exp(-u)); tall=[tall;t]; rall=[rall;r];
20   %% Plotting results
21    surf(tall',1:nn,rall','linestyle','none'); view(0,90);
\end{verbatim} 
}

%%%%%%%%%%%% Slide %%%%%%%%%%%
\frame[containsverbatim] { \frametitle{\large rnn\_ode.m}
\small

\begin{verbatim}
 1   function udot=rnn_ode(t,u,flag,nn,dx,w,I_ext)
 2   % odefile for recurrent network
 3    tau_inv = 1.;      % inverse of membrane time constant
 4    r=1./(1+exp(-u));
 5    sum=w*r*dx;
 6    udot=tau_inv*(-u+sum+I_ext);
 7   return
\end{verbatim}

\emph{Update rule of (recurrent) cortical network: }
$$ {\tau} \frac{{\rm d}u_i(t)}{{\rm d}t}=-u_i(t)+ \frac{1}{N} \sum_j
w_{ij} r_j(t) + \frac{1}{M} \sum_k w^{\rm in}_{ik} r^{\rm in}_k(t)$$

\emph{Activation function: } $
r_j(t) = \frac{1}{1+e^{\beta (u_j(t) - \alpha)}}.
$ 
}

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Path integration}

\begin{center}
\resizebox{8cm}{!}{\includegraphics{figures/DNFheadDirections_slides.pdf}} 
\end{center}

\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Population coding}

\emph{Probability of neural response for a sensory input: } \\ \hspace*{1.8cm} $P(\mathbf{r}|s)=P(r^s_1,r^s_2,r^s_3,...|s)$
\vspace*{0.3cm}

\emph{Decoding: } $P(s|\mathbf{r})=P(s|r^s_1,r^s_2,r^s_3,...)$
\vspace*{0.3cm}

\emph{Stimulus estimate: } $ \hat{s}={\rm arg} \max_s P(s|\mathbf{r})$
\vspace*{0.3cm}

\emph{Bayes's theorem}: $
P(s|\mathbf{r})=\frac{P(\mathbf{r}|s)P(s)}{P(\mathbf{r})}$
\vspace*{0.2cm}


\emph{Maximum likelihood estimate: } $\hat{s}={\rm argmin} \sum_i \left(\frac{r_i-f_i(s)}{\sigma_i} \right)^2$


\end{frame} 

%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Implementations of decoding mechanisms with DNF}

\begin{center}
\resizebox{10cm}{!}{\includegraphics{figures/Chapter7/DNFpopulationDecoding.pdf}} 
\end{center}

\end{frame} 




%%%%%%%%%%%% Slide %%%%%%%%%%%
\begin{frame}
\frametitle{\large Further Readings} 

\begin{list}{}{\setlength\itemindent{-.3in}  \setlength\rightmargin{.1in} \setlength\itemsep{0.05in}}
\footnotesize

\item Teuvo Kohonen (1989), \emph{Self-organization and associative memory}, Springer Verlag, 3rd edition.

\item David J. Willshaw and Christoph von der Malsburg (1976), \emph{How patterned neural connexions can be set up by self-organisation}, in \emph{Proc Roy Soc} B 194, 431--445. 

\item Shun-ichi Amari (1977), \emph{Dynamic pattern formation in lateral-inhibition type neural fields}, in
\emph{Biological Cybernetics} 27: 77--87.

\item Huge R. Wilson and Jack D. Cowan (1973), \emph{A mathematical theory of the functional dynamics of cortical and thalamic nervous tissue}, in \emph{Kybernetik} 13:55-80. 

\item  Kechen Zhang (1996), \emph{Representation of spatial orientation by the intrinsic dynamics of the head-direction cell ensemble: A theory}, in \emph{Journal of Neuroscience}  16: 2112--2126. 

\item Simon M.~Stringer, Thomas P.~Trappenberg, Edmund
T.~Rolls, and Ivan E.T.~de Araujo (2002), \emph{Self-organizing
continuous attractor networks and path integration I:
 One-dimensional models of head direction cells}, in \emph{Network: Computation in Neural Systems} 13:217--242.

\item Alexandre Pouget, Richard S. Zemel, and Peter Dayan (2000), \emph{Information processing with population codes}, in \emph{Nature Review Neuroscience} 1:125--132. 


\end{list} 

\end{frame}

\end{document}







