RBFNode.hpp

Go to the documentation of this file.
00001 #ifndef __RBFNODE_H
00002 #define __RBFNODE_H
00003 
00004 #include <GNGCore/GNGNode.hpp>
00005 #include "RBFWeights.hpp"
00006 #include <cmath>
00007 
00011 class RBFNode : public GNGNode
00012 {
00013 public:
00014     RBFNode(double sigma) 
00015     { 
00016         m_sigma = sigma;
00017     } 
00018 
00019     virtual double Activation(Vector const & input)
00020     {
00021         double squaredDistance = input.SquaredDistance( GetReferenceVector() );
00022         double ret = exp( squaredDistance / (-2.0*pow(m_sigma,2.0)) );
00023         return ret;
00024     }
00025 
00026     virtual void SetWidth(double sigma) 
00027   { 
00028     m_sigma = sigma;
00029     //m_sigma = sigma * 2.0;
00030     //std::cout << "\n SIGMA: " << m_sigma << "  " << std::endl;     
00031   }
00032 
00033     virtual double GetWidth() const { return m_sigma; }
00034 private:
00035     double m_sigma; // the standard deviation of the Gaussian, or the width
00036 };
00037 
00038 
00039 
00040 
00041 class RBFNodeFactory : public GNGNodeFactory
00042 {
00043 public:
00044     RBFNodeFactory(double defaultSigma) { m_sigma = defaultSigma; }
00045     virtual GNGNode * NewNode() { return new RBFNode(m_sigma); }
00046 
00047 private:
00048     double m_sigma;
00049 };
00050 
00051 #endif
00052 

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