Neural Networks 0.2
A framework for Lukas Zdechovan's Neural Networks C++ projects.

NeuralNetwork/FeedforwardNeuralNetwork/FeedforwardThreeLayerNN.h

Go to the documentation of this file.
00001 /*
00002     <one line to give the program's name and a brief idea of what it does.>
00003     Copyright (C) <year>  <name of author>
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 3 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, see <http://www.gnu.org/licenses/>.
00017 
00018 */
00019 
00020 #ifndef FEEDFORWARDTHREELAYERNN_H
00021 #define FEEDFORWARDTHREELAYERNN_H
00022 
00023 #include "../NeuralNetwork.h"
00024 #include "../NeuralNetworkLayer.h"
00025 
00026 namespace NeuralNetwork {
00027 
00031     namespace FeedforwardNeuralNetwork {
00032 
00033     class FeedforwardThreeLayerNN : public NeuralNetwork
00034     {
00035       protected:
00036         // Layers
00037         NeuralNetworkLayer *inputLayer;
00038         NeuralNetworkLayer *hiddenLayer;
00039         NeuralNetworkLayer *outputLayer;
00040         // Weights
00041         double weightsInHid[MAX_NEURONS][MAX_NEURONS];
00042         double weightsHidOut[MAX_NEURONS][MAX_NEURONS];
00043         // Properties
00044         int inputCount, hiddenCount, outputCount;
00045         int biasIndex;
00046             /* override */ void initRandomWeights();
00047             /* override */ void createNetworkLayers();
00048         void updateWeights(double* inHid, double* hidOut);
00049       public: 
00050         FeedforwardThreeLayerNN(int inputCount, int hiddenCount, int outputCount, Utils::Logging::Logger* logger);  
00051             double* feedForward(double *input);
00052     };
00053 
00054     }   
00055 }
00056 
00057 #endif // FEEDFORWARDTHREELAYERNN_H
 All Data Structures Namespaces Files Functions Variables Defines