RBFOutputLayer.hpp

Go to the documentation of this file.
00001 #ifndef __RBFOUTPUTLAYER_H
00002 #define __RBFOUTPUTLAYER_H
00003 
00004 #include "IWeightLayerToOutput.hpp"
00005 #include "IActivation.hpp"
00006 
00007 #include <Vector.hpp>
00008 #include <iostream>
00009 
00010 
00011 class RBFOutputLayer
00012 {
00013 public:
00014     RBFOutputLayer(IActivation * a, unsigned int nofOutputs, IWeightLayerToOutput * w)
00015     {
00016         m_weightLayer = w;
00017         m_activation = a;
00018         m_nofOutputs = nofOutputs;
00019         
00020         m_biases = Vector(m_nofOutputs);
00021     }
00022 
00023     Vector GetOutput()
00024     {
00025         Vector v(m_nofOutputs);
00026         for(unsigned int i=0; i<m_nofOutputs; i++)
00027             v[i] = m_activation->ActivationFucntion( m_weightLayer->GetWeightedSum(i) + m_biases[i] );
00028 
00029         return v;
00030     }
00031 
00032     unsigned int GetNofOutputs() { return m_nofOutputs; }
00033 
00034     void UpdateBias(Vector & etaDiff)
00035     {
00036         int b= m_biases.size();
00037         int a = etaDiff.size();
00038         m_biases += etaDiff;
00039     }
00040 
00041 private:
00042   IActivation *           m_activation;
00043   unsigned int            m_nofOutputs;
00044   Vector                  m_biases;
00045   IWeightLayerToOutput *  m_weightLayer;
00046 };
00047 
00048 #endif
00049 

Generated on Mon Mar 22 16:40:48 2004 for GNG_GL by doxygen 1.3.6