00001 /* boss_nn.h $Revision: 1.2 $ $Date: 2005/12/10 20:33:54 $ 00002 Copyright (C) 2002 University of Bonn. 00003 http://www.ikp.uni-bonn.de/boss 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (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., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00026 #ifndef BOSS_INTONATION_NN_H 00027 #define BOSS_INTONATION_NN_H 00028 00029 //#include "dom/DOM.hpp" 00030 #include "boss_utility/dom_tools.h" 00031 #include "boss_intonation.h" 00032 //#include "boss_nn.h" 00033 #include <iostream> 00034 #include <string> 00035 #include <fstream> 00036 #include <vector> 00037 //#include <stdio.h> 00038 //#include <stdlib.h> 00039 00048 class BOSS_NN { 00049 public: 00050 BOSS_NN(); 00051 ~BOSS_NN(); 00052 bool LoadNN(const string & filename); 00053 bool SaveNN(const string & filename); 00054 vector<float> Calculate(const vector<float> & Input); 00055 float BOSS_NN::net(int Layer, int Neuron, const vector<float> & Input); 00056 void BackProp(vector<float> & DesiredOutput, vector<float> & Output); 00057 void Update(); 00058 void Reset(); 00059 struct t_neuron 00060 { 00061 vector<float> weight; 00062 float deltaw; 00063 float out; 00064 }; 00065 struct t_layer 00066 { 00067 int NumberOfNeurons; 00068 int NumberOfWeights; 00069 vector<t_neuron> neuron; 00070 }; 00071 public: // Public attributes 00072 vector<t_layer> layer; 00073 int NumberOfLayers; 00074 float Learnrate; 00075 float Error; 00076 int m_InputNeurons; 00077 }; 00078 // end of boss_intonation group 00080 #endif 00081