Advertisement
Guest User

network.hpp_old

a guest
Nov 9th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. //------------------------------------------------
  2. //  NETWORK.HPP
  3. //------------------------------------------------
  4.  
  5. #ifndef NETWORK_HPP
  6. #define NETWORK_HPP
  7.  
  8.  
  9. // Libraries
  10. #include <vector>
  11.  
  12. // My Libraries
  13. #include "neuron.hpp"
  14. #include "rne.hpp"
  15. #include "defs.hpp"
  16.  
  17. // Typedefs and Structures
  18.  
  19.  
  20. // Network : Controls the dynamic of the neural network
  21.  
  22. class network
  23. {
  24.     private:
  25.         std::vector<unsigned int> _network_structure;
  26.  
  27.         std::vector<std::vector<neuron>> _neurons;
  28.  
  29.         rne _random_engine;
  30.  
  31.         const double _learnrate, _layerfact;
  32.  
  33.         void _initialize_random_rates();
  34.  
  35.         void _reset_netoutputs();
  36.         void _calculate_netoutputs(std::vector<double> input);
  37.         void _train_network(std::vector<double> errors);
  38.  
  39.     public:
  40.         network(std::vector<unsigned int> neurons_per_layer, rne &random_engine, double learning_rate = 0.1);
  41.  
  42.         double train_epoch(testcases tests);    //testcases from defs.hpp
  43.         std::vector<double> solve(std::vector<double> input);
  44. };
  45.  
  46. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement