\documentclass{article}
\usepackage{verbatim}
\usepackage[pdftex]{graphicx} 
\author{Charles Lohr}
\date{November 23, 2009}
\title{CMSC 675 Neural Networks, Project 2}

\begin{document}
\maketitle

\section*{Introduction}
I have produced a Self-Organizing-Map that was able to untangle a randomly placed grid of 3x3 points onto a uniform set of points.  This randomly placed grid functioned as expected when the random positions were placed over the random space [0, 0.1].  I did not have to modify the learning rate, D or other variables for this part.

\section*{Implementation}
I chose to implement Project 2 using C++ and making my generic nodes into C++ Classes.  Unlike my Project one, each class only contained one function - that was to update weights for one update point.  The classes did contain the weight vector for that point as well as a list of all of its adjaadjacentcent nodes.\newline\newline
I used the same SVG library I implemented for the firs project with only minor changes, one of which including the addition to alpha (or transparency) properties to the output.\newline\newline
By using transparency, I was able to represent several states at the same time.  In order to comply with project descriptions, I printed several graphs, these, however are in general unneeded.

\subsection*{Details}
As described above, I used the suggested values, and they worked well.  My final test values were (for all instances):

\begin{itemize}
\item Learning Rate = 0.5, decreased by 0.01 per epoch.
\item Initial Weights = Random values placed throughout the square in the range [0, 0.1].
\item NeighborhoodNeighborhood Radius (D) = 2; Reduced to 1 after 10 epochs; reduced to 0 after 20 epochs.
\item Experiment run for 50 epochs, always.
\end{itemize}

\section*{Results}
Below is a table of my final results from my standard graph; with the full area scale.  Please note that the graph is flipped top-for-bottom.  Once that is taken into consideration, the points line up correctly.

\begin{center}
Scale: 1.0 Seed: 98
\begin{tabular}{ || c | c | c | c | c | c | c | c || }
\hline
Node & Pos X & Pos Y & Rep X & Rep Y & Num Vec & Avg Vec Dist & Max Vec Dist \\
\hline
0 & 0.13 & 0.82 & 1 & 1 & 11 & 0.12 & 0.19 \\
1 & 0.56 & 0.81 & 2 & 1 & 9 & 0.11 & 0.17 \\
2 & 0.84 & 0.81 & 3 & 1 & 9 & 0.12 & 0.21 \\
3 & 0.20 & 0.50 & 1 & 2 & 9 & 0.13 & 0.19 \\
4 & 0.48 & 0.47 & 2 & 2 & 12 & 0.09 & 0.16 \\
5 & 0.82 & 0.41 & 3 & 2 & 10 & 0.14 & 0.17 \\
6 & 0.21 & 0.18 & 1 & 3 & 10 & 0.16 & 0.22 \\
7 & 0.53 & 0.22 & 2 & 3 & 9 & 0.12 & 0.15 \\
8 & 0.73 & 0.09 & 3 & 3 & 11 & 0.11 & 0.22 \\
\hline
\end{tabular}
\end{center}

Below is the table for extra credit. Please note that the data points are transposed and flipped in both directions.
\begin{center}
Scale: 0.1 Seed: 98
\begin{tabular}{ || c | c | c | c | c | c | c | c || }
\hline
Node & Pos X & Pos Y & Rep X & Rep Y & Num Vec & Avg Vec Dist & Max Vec Dist \\
\hline
0 & 0.84 & 0.81 & 1 & 1 & 9 & 0.12 & 0.21 \\
1 & 0.82 & 0.41 & 2 & 1 & 10 & 0.14 & 0.17 \\
2 & 0.73 & 0.09 & 3 & 1 & 11 & 0.11 & 0.22 \\
3 & 0.56 & 0.81 & 1 & 2 & 9 & 0.11 & 0.17 \\
4 & 0.48 & 0.47 & 2 & 2 & 12 & 0.09 & 0.16 \\
5 & 0.53 & 0.22 & 3 & 2 & 9 & 0.12 & 0.15 \\
6 & 0.13 & 0.82 & 1 & 3 & 11 & 0.12 & 0.19 \\
7 & 0.20 & 0.50 & 2 & 3 & 9 & 0.13 & 0.19 \\
8 & 0.21 & 0.18 & 3 & 3 & 10 & 0.16 & 0.22 \\
\hline
\end{tabular}
\end{center}

An interesting observation about this - and in situations where I randomized the weights' starting places (bar excessive cases) is that all of the weights settle to the same places.  Also, in all situations, this graph produced fairly good results, even in situations where a seed that produced a sideways map was selected.\newline\newline
Please note in the graph below there is no easily visible coordination of the points, however the correlation is still very high.
\newline\newline
\newline\newline
\begin{center}
Scale: 1.0 Seed: 93
\begin{tabular}{ || c | c | c | c | c | c | c | c || }
\hline
Node & Pos X & Pos Y & Rep X & Rep Y & Num Vec & Avg Vec Dist & Max Vec Dist \\
\hline
0 & 0.10 & 0.48 & 1 & 1 & 7 & 0.10 & 0.11 \\
1 & 0.17 & 0.78 & 2 & 1 & 10 & 0.13 & 0.19 \\
2 & 0.47 & 0.85 & 3 & 1 & 7 & 0.15 & 0.18 \\
3 & 0.16 & 0.14 & 1 & 2 & 12 & 0.12 & 0.17 \\
4 & 0.45 & 0.55 & 2 & 2 & 10 & 0.10 & 0.20 \\
5 & 0.77 & 0.85 & 3 & 2 & 8 & 0.10 & 0.15 \\
6 & 0.52 & 0.18 & 1 & 3 & 12 & 0.11 & 0.22 \\
7 & 0.79 & 0.23 & 2 & 3 & 13 & 0.13 & 0.29 \\
8 & 0.86 & 0.55 & 3 & 3 & 11 & 0.12 & 0.16 \\
\hline
\end{tabular}
\newline\newline
\newline\newline
\newline\newline

\end{center}


\subsection*{Graphs}

All graphs are labeled, but are taken at epoch 0, (beginning); epoch 11, after first neighborhood size change;  epoch 21, after second change and epoch 50 (once it is stabilized).
\newline\newline

\begin{center}
Here are the graphs for the standard project (98 seed, 1.0 distribution) 
\includegraphics[width=0.45\textwidth]{981000.png} 
\includegraphics[width=0.45\textwidth]{981011.png} 
\includegraphics[width=0.45\textwidth]{981021.png} 
\includegraphics[width=0.45\textwidth]{981050.png} 
\newline\newline
\end{center}
\begin{center}
Here are the graphs for the standard project (98 seed, 0.1 distribution)
\includegraphics[width=0.45\textwidth]{980100.png} 
\includegraphics[width=0.45\textwidth]{980111.png} 
\includegraphics[width=0.45\textwidth]{980121.png} 
\includegraphics[width=0.45\textwidth]{980150.png} 
\newline\newline
\end{center}
\begin{center}
Here are the graphs for the standard project (93 seed, 1.0 distribution) 
\includegraphics[width=0.45\textwidth]{931000.png} 
\includegraphics[width=0.45\textwidth]{931011.png} 
\includegraphics[width=0.45\textwidth]{931021.png} 
\includegraphics[width=0.45\textwidth]{931050.png} 
\newline\newline
\newline\newline
\end{center}
\begin{center}
Here is a big copy of the first graph after it is stabilized.
\includegraphics[width=1.0\textwidth]{981050.png} 
And of the Extra Credit graph after is has stabilized.
\includegraphics[width=1.0\textwidth]{980150.png} 
\end{center}


\end{document}



