\section{Ki\-Track\-:\-:Hopfield\-Neural\-Net Class Reference}
\label{classKiTrack_1_1HopfieldNeuralNet}\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}


Represents a Hopfield Neural Network.  




{\ttfamily \#include $<$Hopfield\-Neural\-Net.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Hopfield\-Neural\-Net} (std\-::vector$<$ std\-::vector$<$ bool $>$ $>$ G, std\-::vector$<$ double $>$ Q\-I, std\-::vector$<$ double $>$ states, double omega)  throw ( Invalid\-Parameter )
\item 
bool {\bf do\-Iteration} ()
\begin{DoxyCompactList}\small\item\em Does one iteration of the neuronal network. \end{DoxyCompactList}\item 
void {\bf set\-T} (double T)\label{classKiTrack_1_1HopfieldNeuralNet_a163699006985998f8e6af95ee43ed474}

\begin{DoxyCompactList}\small\item\em Sets the temperature of the Neural Network (The H\-N\-N is cooled down in every iteration) \end{DoxyCompactList}\item 
void {\bf set\-T\-Inf} (double T\-Inf)
\begin{DoxyCompactList}\small\item\em Sets the temperature at infinity. \end{DoxyCompactList}\item 
void {\bf set\-Limit\-For\-Stable} (double limit)
\begin{DoxyCompactList}\small\item\em Set the threshhold value below which the H\-N\-N is seen as \char`\"{}stable\char`\"{}. \end{DoxyCompactList}\item 
std\-::vector$<$ double $>$ {\bf get\-States} ()
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
double {\bf activation\-Function} (double state, double T)
\begin{DoxyCompactList}\small\item\em Calculates the activation function. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::vector$<$ std\-::vector\\*
$<$ double $>$ $>$ {\bf \-\_\-\-W}\label{classKiTrack_1_1HopfieldNeuralNet_a2587ec79a472e38bff6b67e836d54fc9}

\begin{DoxyCompactList}\small\item\em the matrix of the weights \end{DoxyCompactList}\item 
std\-::vector$<$ double $>$ {\bf \-\_\-\-States}\label{classKiTrack_1_1HopfieldNeuralNet_aa60f2b037259c5361441b5272417e49e}

\begin{DoxyCompactList}\small\item\em states describing how active a neuron is \end{DoxyCompactList}\item 
std\-::vector$<$ double $>$ {\bfseries \-\_\-w0}\label{classKiTrack_1_1HopfieldNeuralNet_a86e6943ce3492d8a261003a83d21b000}

\item 
double {\bf \-\_\-\-T}\label{classKiTrack_1_1HopfieldNeuralNet_a6fc70708d4317c1af038b69d03cc0970}

\begin{DoxyCompactList}\small\item\em temperature \end{DoxyCompactList}\item 
double {\bf \-\_\-\-T\-Inf}\label{classKiTrack_1_1HopfieldNeuralNet_a48aad08be07dad2d0339848716078889}

\begin{DoxyCompactList}\small\item\em temperature after infinite iterations \end{DoxyCompactList}\item 
bool {\bf \-\_\-is\-Stable}
\begin{DoxyCompactList}\small\item\em indicates if the neuronal network is stable. \end{DoxyCompactList}\item 
double {\bf \-\_\-limit\-For\-Stable}
\begin{DoxyCompactList}\small\item\em The upper limit for change of a neuron, if it should be considered stabel. \end{DoxyCompactList}\item 
double {\bf \-\_\-omega}\label{classKiTrack_1_1HopfieldNeuralNet_a52726795a170cb99a39122216772f8d4}

\begin{DoxyCompactList}\small\item\em Omega controls the influence of the quality indicator on the activation of the neuron. \end{DoxyCompactList}\item 
std\-::vector$<$ unsigned $>$ {\bf \-\_\-order}
\begin{DoxyCompactList}\small\item\em the order of the neurons to be updated. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Represents a Hopfield Neural Network. 

See {\tt this} for detailed info.

Author\-: Robin Glattauer, H\-E\-P\-H\-Y 

\subsection{Constructor \& Destructor Documentation}
\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!Hopfield\-Neural\-Net@{Hopfield\-Neural\-Net}}
\index{Hopfield\-Neural\-Net@{Hopfield\-Neural\-Net}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{Hopfield\-Neural\-Net}]{\setlength{\rightskip}{0pt plus 5cm}Hopfield\-Neural\-Net\-::\-Hopfield\-Neural\-Net (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ std\-::vector$<$ bool $>$ $>$}]{G, }
\item[{std\-::vector$<$ double $>$}]{Q\-I, }
\item[{std\-::vector$<$ double $>$}]{states, }
\item[{double}]{omega}
\end{DoxyParamCaption}
) throw  {\bf Invalid\-Parameter}) }\label{classKiTrack_1_1HopfieldNeuralNet_a43c5513cb124b4e520ba4961c36bad0d}

\begin{DoxyParams}{Parameters}
{\em G} & A matrix of the correlations between the neurons. True means two neurons are incompatible. False means, they are compatible. (the diagonal elements are 0 by definition and any entry there will be ignored and set to 0)\\
\hline
{\em Q\-I} & A vector containing the qualtity indicators of the neurons (i.\-e. their power to amplify or weaken other neurons). Quality should be indicated by a value between 0 and 1. 1 being the highest quality.\\
\hline
{\em states} & The states of the neurons. Should be between 0 and 1.\\
\hline
{\em omega} & Controls the influence of the quality indicator on the activation of the neuron. Needs to be between 0 and 1. 0 means, no influence from the quality of the neurons -\/$>$ system tends to biggest compatible set. 1 means highest influence from the quality of the neurons -\/$>$ the highest quality neurons tend to win. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!activation\-Function@{activation\-Function}}
\index{activation\-Function@{activation\-Function}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{activation\-Function}]{\setlength{\rightskip}{0pt plus 5cm}double Hopfield\-Neural\-Net\-::activation\-Function (
\begin{DoxyParamCaption}
\item[{double}]{state, }
\item[{double}]{T}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classKiTrack_1_1HopfieldNeuralNet_a205bc498cc58973d516958546e24d57f}


Calculates the activation function. 


\begin{DoxyParams}{Parameters}
{\em state} & the state \\
\hline
{\em T} & the temperature \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the activation function corresponding to the input values\-: g(x) = 1/2$\ast$ (1 + tanh( x/\-T )) 
\end{DoxyReturn}


Referenced by do\-Iteration().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!do\-Iteration@{do\-Iteration}}
\index{do\-Iteration@{do\-Iteration}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{do\-Iteration}]{\setlength{\rightskip}{0pt plus 5cm}bool Hopfield\-Neural\-Net\-::do\-Iteration (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classKiTrack_1_1HopfieldNeuralNet_ae0997887c56950ad0835d7e490f9dba4}


Does one iteration of the neuronal network. 

$ \vec{y} = W \times \vec{state} + \vec{w_0} $

$ \vec{state}_{new} = activationFunction(\vec{y}) $

\begin{DoxyReturn}{Returns}
Whether the Neural Network is considered as stable 
\end{DoxyReturn}


References \-\_\-is\-Stable, \-\_\-limit\-For\-Stable, \-\_\-order, \-\_\-\-States, \-\_\-\-T, \-\_\-\-T\-Inf, \-\_\-\-W, and activation\-Function().



Referenced by Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$\-::calculate\-Best\-Set().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!get\-States@{get\-States}}
\index{get\-States@{get\-States}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{get\-States}]{\setlength{\rightskip}{0pt plus 5cm}std\-::vector$<$double$>$ Ki\-Track\-::\-Hopfield\-Neural\-Net\-::get\-States (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classKiTrack_1_1HopfieldNeuralNet_a1edcf806cede3d2f47d658fcd34d68c7}
\begin{DoxyReturn}{Returns}
the vector of the states 
\end{DoxyReturn}


References \-\_\-\-States.



Referenced by Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$\-::calculate\-Best\-Set().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!set\-Limit\-For\-Stable@{set\-Limit\-For\-Stable}}
\index{set\-Limit\-For\-Stable@{set\-Limit\-For\-Stable}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{set\-Limit\-For\-Stable}]{\setlength{\rightskip}{0pt plus 5cm}void Ki\-Track\-::\-Hopfield\-Neural\-Net\-::set\-Limit\-For\-Stable (
\begin{DoxyParamCaption}
\item[{double}]{limit}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classKiTrack_1_1HopfieldNeuralNet_a844c05db1aea01595c3a164dc7cf451d}


Set the threshhold value below which the H\-N\-N is seen as \char`\"{}stable\char`\"{}. 

As long as any Neuron changes its state by a value bigger than this, the H\-N\-N is not considered stable. When all Neurons change their states so little, that none of the changes exceeds this threshold, then the H\-N\-N is stable. 

References \-\_\-limit\-For\-Stable.



Referenced by Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$\-::calculate\-Best\-Set().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!set\-T\-Inf@{set\-T\-Inf}}
\index{set\-T\-Inf@{set\-T\-Inf}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{set\-T\-Inf}]{\setlength{\rightskip}{0pt plus 5cm}void Ki\-Track\-::\-Hopfield\-Neural\-Net\-::set\-T\-Inf (
\begin{DoxyParamCaption}
\item[{double}]{T\-Inf}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classKiTrack_1_1HopfieldNeuralNet_a99746cb5e78c0ff16c3e86658cf1a8ea}


Sets the temperature at infinity. 

The temperature will converge to this value after infinite iterations. 

References \-\_\-\-T\-Inf.



Referenced by Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$\-::calculate\-Best\-Set().



\subsection{Member Data Documentation}
\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!\-\_\-is\-Stable@{\-\_\-is\-Stable}}
\index{\-\_\-is\-Stable@{\-\_\-is\-Stable}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{\-\_\-is\-Stable}]{\setlength{\rightskip}{0pt plus 5cm}bool Ki\-Track\-::\-Hopfield\-Neural\-Net\-::\-\_\-is\-Stable\hspace{0.3cm}{\ttfamily [protected]}}\label{classKiTrack_1_1HopfieldNeuralNet_a015b3bc1fd2e246f93db5b0f970d8e5b}


indicates if the neuronal network is stable. 

this is true when the change after one iteration of any neuron is not bigger than the value \-\_\-limit\-For\-Stable. 

Referenced by do\-Iteration().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!\-\_\-limit\-For\-Stable@{\-\_\-limit\-For\-Stable}}
\index{\-\_\-limit\-For\-Stable@{\-\_\-limit\-For\-Stable}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{\-\_\-limit\-For\-Stable}]{\setlength{\rightskip}{0pt plus 5cm}double Ki\-Track\-::\-Hopfield\-Neural\-Net\-::\-\_\-limit\-For\-Stable\hspace{0.3cm}{\ttfamily [protected]}}\label{classKiTrack_1_1HopfieldNeuralNet_a13cfcf1e56da4ca150d1d743b83dad16}


The upper limit for change of a neuron, if it should be considered stabel. 



Referenced by do\-Iteration(), and set\-Limit\-For\-Stable().

\index{Ki\-Track\-::\-Hopfield\-Neural\-Net@{Ki\-Track\-::\-Hopfield\-Neural\-Net}!\-\_\-order@{\-\_\-order}}
\index{\-\_\-order@{\-\_\-order}!KiTrack::HopfieldNeuralNet@{Ki\-Track\-::\-Hopfield\-Neural\-Net}}
\subsubsection[{\-\_\-order}]{\setlength{\rightskip}{0pt plus 5cm}std\-::vector$<$unsigned$>$ Ki\-Track\-::\-Hopfield\-Neural\-Net\-::\-\_\-order\hspace{0.3cm}{\ttfamily [protected]}}\label{classKiTrack_1_1HopfieldNeuralNet_ac9a74491548c2438d59cc5239c6cd3c8}


the order of the neurons to be updated. 

So it should of course reach from 0 to the number of neurons -\/1. (4 , 2, 0 1, 3) will for example mean\-: update first the neuron 4, then the neuron 2, then 0 and so on 

Referenced by do\-Iteration().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Hopfield\-Neural\-Net.\-h\item 
Hopfield\-Neural\-Net.\-cc\end{DoxyCompactItemize}
