forked from kevinking/Ranklibc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNeuron.h
56 lines (47 loc) · 1008 Bytes
/
Neuron.h
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
49
50
51
52
53
54
55
56
#ifndef NEURON_H
#define NEURON_H
#include "TransferFunction.h"
#include "Synapse.h"
#include "PropParameter.h"
#include <vector>
using std::vector;
class Synapse;
class Neuron
{
public:
Neuron();
virtual ~Neuron();
static double momentum;
static double learningRate;
TransferFunction *tfunc;
double output;// sigmoid(wsum)
vector<double> *outputs;
double delta_i;
vector<double>* deltas_j;
vector<Synapse*> *inLinks;
vector<Synapse*> *outLinks;
double getOutput()
{
return output;
}
double getOutput(int i)
{
return outputs->at(i);
}
void setOutput(double v)
{
output = v;
}
void addOutputs(double v)
{
outputs->push_back(v);
}
void computeOutput();
void computeOutput(int i);
void computerDeltaOfOuputLayer(PropParameter *param);
void updateDelta(PropParameter *param);
void updateWeight(PropParameter *param);
protected:
private:
};
#endif // NEURON_H