include/libradialfunctions.h

Go to the documentation of this file.
00001 /********************************************************************************
00002  *  Neural Network Framework.                                                   *
00003  *  Copyright (C) 2005-2008 Gianluca Massera <emmegian@yahoo.it>                *
00004  *                                                                              *
00005  *  This program is free software; you can redistribute it and/or modify        *
00006  *  it under the terms of the GNU General Public License as published by        *
00007  *  the Free Software Foundation; either version 2 of the License, or           *
00008  *  (at your option) any later version.                                         *
00009  *                                                                              *
00010  *  This program is distributed in the hope that it will be useful,             *
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00013  *  GNU General Public License for more details.                                *
00014  *                                                                              *
00015  *  You should have received a copy of the GNU General Public License           *
00016  *  along with this program; if not, write to the Free Software                 *
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00018  ********************************************************************************/
00019 
00020 #ifndef LIBRADIALFUNCTIONS_H
00021 #define LIBRADIALFUNCTIONS_H
00022 
00023 #include "types.h"
00024 
00030 #include "outputfunction.h"
00031 #include "derivableoutputfunction.h"
00032 
00033 
00034 namespace nnfw {
00035 
00047 class NNFW_API GaussFunction : public DerivableOutputFunction {
00048 public:
00051 
00053     GaussFunction( Real centre = 0.0, Real variance = 1.0, Real maxvaule = 1.0 );
00054 
00056     GaussFunction( PropertySettings& prop );
00057 
00059     virtual ~GaussFunction() { /* Nothing to do */ };
00060 
00062 
00064 
00066     bool setCentre( const Variant& v );
00068     Variant getCentre();
00069 
00071     bool setVariance( const Variant& v );
00073     Variant getVariance();
00074 
00076     bool setMax( const Variant& v );
00078     Variant getMax();
00079 
00081     virtual void apply( RealVec& inputs, RealVec& outputs );
00083     virtual void derivate( const RealVec& x, const RealVec& y, RealVec& d ) const;
00085     virtual GaussFunction* clone() const;
00086 
00088 
00089 private:
00090     // centre
00091     Real centre;
00092     // variance
00093     Real variance;
00094     // minus squared-variance
00095     Real msqrvar;
00096     // max value
00097     Real max;
00098 };
00099 
00100 }
00101 
00102 #endif
00103 
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!