Perceptron.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2008 Soeren Sonnenburg
00008  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _PERCEPTRON_H___
00012 #define _PERCEPTRON_H___
00013 
00014 #include <stdio.h>
00015 #include "lib/common.h"
00016 #include "features/Features.h"
00017 #include "classifier/LinearClassifier.h"
00018 
00020 class CPerceptron : public CLinearClassifier
00021 {
00022     public:
00024         CPerceptron();
00025 
00031         CPerceptron(CRealFeatures* traindat, CLabels* trainlab);
00032         virtual ~CPerceptron();
00033 
00038         virtual inline EClassifierType get_classifier_type() { return CT_PERCEPTRON; }
00039 
00044         virtual bool train();
00045 
00047         inline void set_learn_rate(DREAL r)
00048         {
00049             learn_rate=r;
00050         }
00051 
00053         inline void set_max_iter(INT i)
00054         {
00055             max_iter=i;
00056         }
00057 
00058     protected:
00060         DREAL learn_rate;
00062         INT max_iter;
00063 };
00064 #endif

SHOGUN Machine Learning Toolbox - Documentation