SuperNN  0.7.0
runner.hpp
1 /*
2  This file is part of SuperNN.
3 
4  SuperNN is free software: you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  SuperNN is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with SuperNN. If not, see <http://www.gnu.org/licenses/>.
16 
17  Copyright (C) 2010 - 2014 Lucas Hermann Negri
18 */
19 
20 #ifndef SUPERNN_RUNNER_HPP
21 #define SUPERNN_RUNNER_HPP
22 
23 #include <vector>
24 #include <string>
25 #include "network.hpp"
26 #include "data.hpp"
27 
28 namespace SuperNN
29 {
30 class Bounds;
31 
36 struct Runner
37 {
45  Runner(const std::string &net_path, const std::string &info_path);
46 
47  Runner();
48  virtual ~Runner();
49 
56  void load_info_file(const std::string &info_path);
57 
65  void set_bounds(Bounds &from, Bounds &to);
66 
73  double &inp(unsigned idx);
74 
81  double out(unsigned idx);
82 
87  void run();
88 
91 };
92 }
93 
94 #endif
void set_bounds(Bounds &from, Bounds &to)
Sets the bounds from already built Bound objects.
Definition: runner.cpp:41
void load_info_file(const std::string &info_path)
Loads the bounds info file.
Definition: runner.cpp:68
void run()
Runs the network with the current input setted by inp().
Definition: runner.cpp:85
double & inp(unsigned idx)
Accessor to get/set an input value.
Definition: runner.cpp:75
double out(unsigned idx)
Accessor to get an output value.
Definition: runner.cpp:80
Auxiliary class to ease the usage of an already trained neural network.
Definition: runner.hpp:36
virtual ~Runner()
Definition: runner.cpp:37
Data scaling information, for all input and output neurons.
Definition: data.hpp:47
Network net
Definition: runner.hpp:89
Artificial neural network structure that supports arbitrary feedforward topologies, like multilayer perceptrons and fully connected cascade networks.
Definition: network.hpp:78
Data used in training, validation and testing.
Definition: data.hpp:95