#ifndef NLAYER_HPP #define NLAYER_HPP 1 #include #include #include "neuron.hpp" #include "util.hpp" using namespace std; class NLayer { private: vector neurons; // These layers are simple enough that we just store all necessary training // information in the layer vector signals; vector inputs; vector outputs; // Learning rate, number of neurons, and size of input double eta; int layerSize; int inputVectorSize; // Too lazy to write copy constructor/assignment operator NLayer& operator=(const NLayer rhs); NLayer(NLayer& l); public: // Constructor/Destructor NLayer(int ivs, int s); ~NLayer(); int size(); // Training/Operation functions vector calcLayerOutput(vector inputs); vector calcSignals(vector targets); vector calcSignals(vector err, vector< vector > w); void updateWeights(double eta); // Returns input weights in terms of output weights from the previous layer vector< vector > getInputWeights(); ostream& print(ostream& out); }; ostream& operator<<(ostream& out, NLayer& n); #endif // NLAYER_HPP