-
Notifications
You must be signed in to change notification settings - Fork 0
/
ann.hpp
executable file
·41 lines (33 loc) · 1.06 KB
/
ann.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <functional>
#include <vector>
struct Ann_settings{
int number_of_inputs;
int number_of_hidden_neurons;
int number_of_outputs;
double initial_weight_range;
std::function<double(double)> activation_function;
};
class Network{
private:
Ann_settings ann_settings;
public:
Network(Ann_settings settings);
std::vector<double> evaluate(std::vector<double> inputs);
private:
std::vector<double> input_neurons;
std::vector<double> hidden_neurons;
std::vector<double> output_neurons;
int total_number_of_input_weights;
int total_number_of_hidden_weights;
std::vector<double> input_weights;
std::vector<double> hidden_weights;
public:
void init_network();
void init_weights();
public:
std::vector<double> get_input_weights();
std::vector<double> get_hidden_weights();
void set_input_weights(std::vector<double> input_weights);
void set_hidden_weights(std::vector<double> hidden_weights);
};