Main Page   Namespace List   Alphabetical List   Compound List   File List   Compound Members   File Members  

neuron.cpp

Go to the documentation of this file.
00001 //----------------------------------neuron.cpp------------------------------
00002 //
00003 //    NEREK by Chad Rempp
00004 //    March 1 2002
00005 //    Version 0.0.02
00006 //
00007 //    Flat out stolen from M Buckland's Neural Ants program.
00008 //
00009 //    Feedforward NN code.
00010 //    Classes:
00011 //        Neuron
00012 //        NeuronLayer
00013 //
00014 //------------------------------------------------------------------------------
00015 
00016 #include "neuron.h"
00017 
00018 extern SimData_typ g_SimData;
00019 
00020 
00021 //*************************** methods for Neuron **********************
00022 //
00023 //---------------------------------------------------------------------
00024 
00025 Neuron::Neuron(int NumInputs): m_NumInputs(NumInputs+1){
00026 
00027     //we need an additional weight for the bias hence the +1
00028     for (int i=0; i<NumInputs+1; i++){
00029         m_vecWeight.push_back(RANDOM_CLAMP);
00030     }
00031 }
00032 
00033 
00034 
00035 
00036 //************************ methods for NeuronLayer ***********************
00037 //
00038 //-----------------------------------------------------------------------
00039 
00040 
00041 NeuronLayer::NeuronLayer(int NumNeurons, 
00042                            int NumInputsPerNeuron): m_NumNeurons(NumNeurons), 
00043                                                     m_NumInputsPerNeuron(NumInputsPerNeuron)
00044 {
00045     for (int i=0; i<NumNeurons; i++)
00046 
00047         m_vecNeurons.push_back(Neuron(NumInputsPerNeuron));
00048 }
00049 
00050 

Generated on Mon Jun 9 19:13:21 2003 for NeReK Documentation by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002