-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRNN_Connection.hpp
48 lines (40 loc) · 1.01 KB
/
RNN_Connection.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
42
43
44
45
46
47
48
/*
* RNN_Connection.hpp
*
* Revision: November 2018
* Author: Thassyo Pinto - [email protected]
*/
#ifndef RNN_CONNECTION_HPP_
#define RNN_CONNECTION_HPP_
// A connection class for neural networks.
class Connection{
public:
// Constructor. Creates a new connection in the nerual network.
// Sets the source, target, weight of this connection.
Connection(size_t source, size_t target, double weight):
_source(source),
_target(target),
_weight(weight){
}
// Returns the weight of this connection.
const double& getWeight(){
return _weight;
}
// Sets the weight of this connection.
void setWeight(double weight){
_weight = weight;
}
// Returns the source of this connection.
const size_t& getSource(){
return _source;
}
// Returns the target of this connection.
const size_t& getTarget(){
return _target;
}
protected:
size_t _source;
size_t _target;
double _weight;
};
#endif /* RNN_CONNECTION_HPP_ */