#ifndef NETWORK_H #define NETWORK_H /////////////////////////////////////////////////////////////// // network.h - declares a network of layers with neurons // // ver 1.0 // // // // Language: Visual C++, ver 6.0 // // Platform: Dell XPS B1000r, Windows 2000 // // Application: Prototype for Pr#1, ELE 591/791 // // Author: Jim Fawcett, CST 2-187, Syracuse Univ // // (315) 443-3948, jfawcett@twcny.rr.com // /////////////////////////////////////////////////////////////// /* Module Contents =============== This module defines a network class. Its operations are simple. Operations ========== */ // /////////////////////////////////////////////////////////////// // Build Process // /////////////////////////////////////////////////////////////// // Required Files: // // network.h, network.cpp, layer.h, layer.cpp, // // neuron.h, neuron.cpp // // // // Compiler Command: // // cl /GX /DTEST_NETWORK network.cpp layer.cpp neuron.cpp // /////////////////////////////////////////////////////////////// /* Maintenance History =================== ver 1.0 : 12 Jun 2000 - first release */ /////////////////////////////////////////////////////////////// // network class - container for layers of neurons #include #include "layer.h" class network { public: network(); ~network(); void addLayer(layer *l); int size(); double output(int selectOutput); void input(int selectInput, double value); void setWeights(int layer); void showInputs(std::ostream &out, const char *msg); void showOutputs(std::ostream &out, const char *msg); void showWeights(std::ostream &out, const char *msg); void showLayerOutputs(std::ostream &out, const char *msg); private: std::vector _layers; }; //----< network size = number of layers it contains >---------- inline network::size() { return _layers.size(); } //----< add a layer to network >------------------------------- inline void network::addLayer(layer *l) { _layers.push_back(l); } //----< show inputs to network >------------------------------- inline void network::showInputs(std::ostream &out, const char *msg) { _layers[0]->showInputs(out,msg); } #endif