-
Notifications
You must be signed in to change notification settings - Fork 0
/
Neuron.hpp
42 lines (34 loc) · 746 Bytes
/
Neuron.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
#ifndef NEURON_H
#define NEURON_H
#include "CfgFile.hpp"
#include "ActivationFunctions.hpp"
class Neuron
{
private:
short num_inputs;
double *weights;
double threshold;
Neuron **inputs;
double value;
void initWeights();
void initInputs();
public:
static CfgFile *config;
static void set_config( CfgFile& cfg );
Neuron();
Neuron( int num );
Neuron( int num, double *weights, int num_weights );
~Neuron();
void init( int num );
double evaluate();
void setWeights( double *sw, int nw );
void setWeight( short i, double weight );
double getWeight( short i );
void setValue( double val );
double getValue();
void setLink( short i, Neuron *n );
bool isInput();
short getNumInputs();
bool isOrNeuron;
};
#endif